summaryrefslogtreecommitdiffstats
path: root/tools/iio/lsiio.c
diff options
context:
space:
mode:
authorCristina Opriceana <cristina.opriceana@gmail.com>2015-07-13 16:15:56 +0300
committerJonathan Cameron <jic23@kernel.org>2015-07-20 18:41:22 +0100
commitff1ac639b395d58bbd99ff4a36b10eebb81544a3 (patch)
tree2668b619972abfcc7025c2f56fda8fba60ef508a /tools/iio/lsiio.c
parent8ab6abfca09c1800dccb753775f6ce8ee82f50dd (diff)
downloadlinux-ff1ac639b395d58bbd99ff4a36b10eebb81544a3.tar.bz2
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 <cristina.opriceana@gmail.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools/iio/lsiio.c')
-rw-r--r--tools/iio/lsiio.c10
1 files changed, 5 insertions, 5 deletions
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;