tools:iio: adjust coding style

Fix various coding style issues, including:
  * have spaces around operators
  * indentation
  * consolidate parameters in same line
  * required braces
  * adjust/drop comments
  * multiline comment style
  * delete unnecessary empty lines
  * add empty lines to visualize logial code blocks
  * typos

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
diff --git a/tools/iio/lsiio.c b/tools/iio/lsiio.c
index b59ee17..f5b3bd0 100644
--- a/tools/iio/lsiio.c
+++ b/tools/iio/lsiio.c
@@ -20,7 +20,6 @@
 #include <sys/dir.h>
 #include "iio_utils.h"
 
-
 static enum verbosity {
 	VERBLEVEL_DEFAULT,	/* 0 gives lspci behaviour */
 	VERBLEVEL_SENSORS,	/* 1 lists sensors */
@@ -29,17 +28,16 @@
 const char *type_device = "iio:device";
 const char *type_trigger = "trigger";
 
-
 static inline int check_prefix(const char *str, const char *prefix)
 {
 	return strlen(str) > strlen(prefix) &&
-		strncmp(str, prefix, strlen(prefix)) == 0;
+	       strncmp(str, prefix, strlen(prefix)) == 0;
 }
 
 static inline int check_postfix(const char *str, const char *postfix)
 {
 	return strlen(str) > strlen(postfix) &&
-		strcmp(str + strlen(str) - strlen(postfix), postfix) == 0;
+	       strcmp(str + strlen(str) - strlen(postfix), postfix) == 0;
 }
 
 static int dump_channels(const char *dev_dir_name)
@@ -50,11 +48,11 @@
 	dp = opendir(dev_dir_name);
 	if (dp == NULL)
 		return -errno;
+
 	while (ent = readdir(dp), ent != NULL)
 		if (check_prefix(ent->d_name, "in_") &&
-		    check_postfix(ent->d_name, "_raw")) {
+		    check_postfix(ent->d_name, "_raw"))
 			printf("   %-10s\n", ent->d_name);
-		}
 
 	return (closedir(dp) == -1) ? -errno : 0;
 }
@@ -69,6 +67,7 @@
 			"%i", &dev_idx);
 	if (retval != 1)
 		return -EINVAL;
+
 	retval = read_sysfs_string("name", dev_dir_name, name);
 	if (retval)
 		return retval;
@@ -77,6 +76,7 @@
 
 	if (verblevel >= VERBLEVEL_SENSORS)
 		return dump_channels(dev_dir_name);
+
 	return 0;
 }
 
@@ -90,11 +90,13 @@
 			"%i", &dev_idx);
 	if (retval != 1)
 		return -EINVAL;
+
 	retval = read_sysfs_string("name", dev_dir_name, name);
 	if (retval)
 		return retval;
 
 	printf("Trigger %03d: %s\n", dev_idx, name);
+
 	return 0;
 }
 
@@ -151,6 +153,7 @@
 			free(dev_dir_name);
 		}
 	}
+
 	return (closedir(dp) == -1) ? -errno : 0;
 
 error_close_dir: