diff options
author | Hartmut Knaack <knaack.h@gmx.de> | 2015-06-10 22:51:20 +0300 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-06-13 20:49:43 +0300 |
commit | 7663a4aac625268674060d78ee00f97a36a03af7 (patch) | |
tree | 36e0b59f93717880690914e5265976f3a477878e /tools/iio/iio_event_monitor.c | |
parent | 4f3ca89351e62f72144ca592c1c482e529d31539 (diff) | |
download | linux-7663a4aac625268674060d78ee00f97a36a03af7.tar.xz |
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>
Diffstat (limited to 'tools/iio/iio_event_monitor.c')
-rw-r--r-- | tools/iio/iio_event_monitor.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c index 016760e769c0..a4ab6bb8f872 100644 --- a/tools/iio/iio_event_monitor.c +++ b/tools/iio/iio_event_monitor.c @@ -13,7 +13,6 @@ * * Usage: * iio_event_monitor <device_name> - * */ #include <unistd.h> @@ -209,7 +208,8 @@ static void print_event(struct iio_event_data *event) if (!event_is_known(event)) { printf("Unknown event: time: %lld, id: %llx\n", - event->timestamp, event->id); + event->timestamp, event->id); + return; } @@ -229,6 +229,7 @@ static void print_event(struct iio_event_data *event) if (dir != IIO_EV_DIR_NONE) printf(", direction: %s", iio_ev_dir_text[dir]); + printf("\n"); } @@ -251,14 +252,16 @@ int main(int argc, char **argv) dev_num = find_type_by_name(device_name, "iio:device"); if (dev_num >= 0) { printf("Found IIO device with name %s with device number %d\n", - device_name, dev_num); + device_name, dev_num); ret = asprintf(&chrdev_name, "/dev/iio:device%d", dev_num); if (ret < 0) { return -ENOMEM; } } else { - /* If we can't find a IIO device by name assume device_name is a - IIO chrdev */ + /* + * If we can't find an IIO device by name assume device_name is + * an IIO chrdev + */ chrdev_name = strdup(device_name); if (!chrdev_name) return -ENOMEM; |