From ff1ac639b395d58bbd99ff4a36b10eebb81544a3 Mon Sep 17 00:00:00 2001 From: Cristina Opriceana Date: Mon, 13 Jul 2015 16:15:56 +0300 Subject: tools: iio: Remove explicit NULL comparison Remove explicit NULL comparison and write it in its simpler form as recommended by checkpatch.pl. Signed-off-by: Cristina Opriceana Reviewed-by: Hartmut Knaack Signed-off-by: Jonathan Cameron --- tools/iio/lsiio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools/iio/lsiio.c') diff --git a/tools/iio/lsiio.c b/tools/iio/lsiio.c index 7f432a55a6c4..4f8172fe7881 100644 --- a/tools/iio/lsiio.c +++ b/tools/iio/lsiio.c @@ -46,10 +46,10 @@ static int dump_channels(const char *dev_dir_name) const struct dirent *ent; dp = opendir(dev_dir_name); - if (dp == NULL) + if (!dp) return -errno; - while (ent = readdir(dp), ent != NULL) + while (ent = readdir(dp), ent) if (check_prefix(ent->d_name, "in_") && check_postfix(ent->d_name, "_raw")) printf(" %-10s\n", ent->d_name); @@ -107,12 +107,12 @@ static int dump_devices(void) DIR *dp; dp = opendir(iio_dir); - if (dp == NULL) { + if (!dp) { printf("No industrial I/O devices available\n"); return -ENODEV; } - while (ent = readdir(dp), ent != NULL) { + while (ent = readdir(dp), ent) { if (check_prefix(ent->d_name, type_device)) { char *dev_dir_name; @@ -134,7 +134,7 @@ static int dump_devices(void) } } rewinddir(dp); - while (ent = readdir(dp), ent != NULL) { + while (ent = readdir(dp), ent) { if (check_prefix(ent->d_name, type_trigger)) { char *dev_dir_name; -- cgit v1.2.3