Fix a few spelling errors in code

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
diff --git a/include/swtpm/tpm_ioctl.h b/include/swtpm/tpm_ioctl.h
index e506ef5..bba8d4a 100644
--- a/include/swtpm/tpm_ioctl.h
+++ b/include/swtpm/tpm_ioctl.h
@@ -240,7 +240,7 @@
         } req; /* request */
         struct {
             ptm_res tpm_result;
-        } resp; /* reponse */
+        } resp; /* response */
     } u;
 };
 
diff --git a/src/swtpm/common.c b/src/swtpm/common.c
index bb87f3a..b15f900 100644
--- a/src/swtpm/common.c
+++ b/src/swtpm/common.c
@@ -794,7 +794,7 @@
 
     if (chmod(su.sun_path, perm) < 0) {
         logprintf(STDERR_FILENO,
-                  "Could not change permssions on UnixIO socket: %s\n",
+                  "Could not change permissions on UnixIO socket: %s\n",
                   strerror(errno));
         goto error;
     }
@@ -1027,7 +1027,7 @@
             goto error;
         }
     } else {
-        logprintf(STDERR_FILENO, "Unsupport control channel type: %s\n", type);
+        logprintf(STDERR_FILENO, "Unsupported control channel type: %s\n", type);
         goto error;
     }
 
@@ -1171,7 +1171,7 @@
             *c = server_new(fd, flags, NULL);
         }
     } else {
-        logprintf(STDERR_FILENO, "Unsupport socket type: %s\n", type);
+        logprintf(STDERR_FILENO, "Unsupported socket type: %s\n", type);
         goto error;
     }
 
diff --git a/src/swtpm/ctrlchannel.c b/src/swtpm/ctrlchannel.c
index 7b77a04..4b559c0 100644
--- a/src/swtpm/ctrlchannel.c
+++ b/src/swtpm/ctrlchannel.c
@@ -301,12 +301,12 @@
  * ctrlchannel_recv_cmd: Receive a command on the control channel
  *
  * @fd: file descriptor for control channel
- * @msg: prepared msghdr struct for receiveing data with single
+ * @msg: prepared msghdr struct for receiving data with single
  *       msg_iov.
  *
  * This function returns 0 or a negative number if an error receiving
  * the command occurred, including a timeout. In case of success,
- * the nunber of bytes received is returned.
+ * the number of bytes received is returned.
  */
 static ssize_t ctrlchannel_recv_cmd(int fd,
                                     struct msghdr *msg)
@@ -476,7 +476,7 @@
  *            number when set via CMD_SET_LOCALITY
  * @tpm_running: indicates whether the TPM is running; may be changed by
  *               this function in case TPM is stopped or started
- * @mlp: mainloop parameters used; may be altered by this function incase of
+ * @mlp: mainloop parameters used; may be altered by this function in case of
  *       CMD_SET_DATAFD
  *
  * This function returns the passed file descriptor or -1 in case the
diff --git a/src/swtpm/cuse_tpm.c b/src/swtpm/cuse_tpm.c
index faafda3..854355b 100644
--- a/src/swtpm/cuse_tpm.c
+++ b/src/swtpm/cuse_tpm.c
@@ -122,7 +122,7 @@
 /* whether NVRAM storage is currently locked */
 static bool g_storage_locked;
 
-/* whether to relase the lock on outgoing migration */
+/* whether to release the lock on outgoing migration */
 static bool g_release_lock_outgoing;
 
 /* how many times to retry locking; use for fallback after releasing
@@ -144,7 +144,7 @@
 # endif
 #else
 
-#error Unsupport glib version
+#error Unsupported glib version
 
 #endif
 
@@ -488,7 +488,7 @@
  * tpm_start: Start the TPM
  *
  * Check whether the TPM's state directory exists and if it does
- * not exists, try to creat it. Start the thread pool, initilize
+ * not exists, try to create it. Start the thread pool, initialize
  * libtpms and allocate a global TPM request buffer.
  *
  * @flags: libtpms init flags
@@ -1008,7 +1008,7 @@
 }
 
 /*
- * ptm_write: low-level write() interface; calls approriate function depending
+ * ptm_write: low-level write() interface; calls appropriate function depending
  *            on what is being transferred using the write()
  */
 static void ptm_write(fuse_req_t req, const char *buf, size_t size,
diff --git a/src/swtpm/seccomp_profile.c b/src/swtpm/seccomp_profile.c
index 7299b89..ff81fcc 100644
--- a/src/swtpm/seccomp_profile.c
+++ b/src/swtpm/seccomp_profile.c
@@ -221,7 +221,7 @@
         SCMP_SYS(removexattr),
         SCMP_SYS(lremovexattr),
         SCMP_SYS(fremovexattr),
-        /* processs forking */
+        /* process forking */
         SCMP_SYS(execve),
         /* io */
         SCMP_SYS(iopl),
diff --git a/src/swtpm/seccomp_profile.h b/src/swtpm/seccomp_profile.h
index 921343d..004dc49 100644
--- a/src/swtpm/seccomp_profile.h
+++ b/src/swtpm/seccomp_profile.h
@@ -1,5 +1,5 @@
 /*
- * seccomp_profile.h -- seccomp profile suppport
+ * seccomp_profile.h -- seccomp profile support
  *
  * (c) Copyright IBM Corporation 2019.
  *
diff --git a/src/swtpm/threadpool.c b/src/swtpm/threadpool.c
index ee0d1b4..aad1f4d 100644
--- a/src/swtpm/threadpool.c
+++ b/src/swtpm/threadpool.c
@@ -65,7 +65,7 @@
 # endif
 #else
 
-#error Unsupport glib version
+#error Unsupported glib version
 
 #endif
 
diff --git a/src/swtpm_cert/ek-cert.c b/src/swtpm_cert/ek-cert.c
index eec5c70..fa14e70 100644
--- a/src/swtpm_cert/ek-cert.c
+++ b/src/swtpm_cert/ek-cert.c
@@ -198,7 +198,7 @@
 
     result = malloc(len / 2);
     if (result == NULL) {
-        fprintf(stderr, "Out of memory tring to allocated %d bytes.", len / 2);
+        fprintf(stderr, "Out of memory trying to allocated %d bytes.", len / 2);
         return NULL;
     }
     i = 0;
@@ -927,7 +927,7 @@
  * file:<filename>
  * env:<environment variable>
  * Any password read from files must not exceed 256 bytes including
- * teminating 0 byte.
+ * terminating 0 byte.
  */
 static char *get_password(const char *password)
 {
diff --git a/src/swtpm_localca/swtpm_localca.c b/src/swtpm_localca/swtpm_localca.c
index a017a01..6941d45 100644
--- a/src/swtpm_localca/swtpm_localca.c
+++ b/src/swtpm_localca/swtpm_localca.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause */
 /*
- * swtpm_localca.c: A tool for creating TPM 1.2 and TPM 2 certificates localy or using pkcs11
+ * swtpm_localca.c: A tool for creating TPM 1.2 and TPM 2 certificates locally or using pkcs11
  *
  * Author: Stefan Berger, stefanb@linux.ibm.com
  *
diff --git a/src/swtpm_localca/swtpm_localca_utils.c b/src/swtpm_localca/swtpm_localca_utils.c
index c797aac..5702307 100644
--- a/src/swtpm_localca/swtpm_localca_utils.c
+++ b/src/swtpm_localca/swtpm_localca_utils.c
@@ -78,7 +78,7 @@
 }
 
 /* Extract all environment variables from the config file and add them to
- * the given environent.
+ * the given environment.
  * Environment variable lines must start with 'env:' and must not contain
  * trailing spaces or a comment starting with '#'
  */
diff --git a/src/swtpm_setup/swtpm.c b/src/swtpm_setup/swtpm.c
index 637eaa0..dbec800 100644
--- a/src/swtpm_setup/swtpm.c
+++ b/src/swtpm_setup/swtpm.c
@@ -488,7 +488,7 @@
     return NULL;
 }
 
-/* Give the name of a hash bank, return its algo identifer */
+/* Give the name of a hash bank, return its algo identifier */
 static uint16_t get_hashalg_by_bankname(const char *name) {
     size_t i;
 
diff --git a/src/swtpm_setup/swtpm_setup.c b/src/swtpm_setup/swtpm_setup.c
index 60f0a8d..8153b9d 100644
--- a/src/swtpm_setup/swtpm_setup.c
+++ b/src/swtpm_setup/swtpm_setup.c
@@ -906,7 +906,7 @@
         "                 : This option is deprecated and has no effect.\n"
         "\n"
         "--print-capabilities\n"
-        "                 : Print JSON formatted capabilites added after v0.1 and exit.\n"
+        "                 : Print JSON formatted capabilities added after v0.1 and exit.\n"
         "\n"
         "--create-config-files [[overwrite][,root]]\n"
         "                 : Create swtpm_setup and swtpm-localca config files for a\n"
@@ -1039,7 +1039,7 @@
     return 0;
 }
 
-/* Print teh JSON object of swtpm_setup's capabilities */
+/* Print the JSON object of swtpm_setup's capabilities */
 static int print_capabilities(char **swtpm_prg_l, gboolean swtpm_has_tpm12,
                               gboolean swtpm_has_tpm2)
 {
diff --git a/src/utils/swtpm_utils.c b/src/utils/swtpm_utils.c
index 86c67f9..d1f41e2 100644
--- a/src/utils/swtpm_utils.c
+++ b/src/utils/swtpm_utils.c
@@ -378,7 +378,7 @@
     return -1;
 }
 
-/* replace occurences of 'torep' with 'rep' in a string 'in' */
+/* replace occurrences of 'torep' with 'rep' in a string 'in' */
 gchar *str_replace(const char *in, const char *torep, const char *rep)
 {
     char *res;