summaryrefslogtreecommitdiff
path: root/tools/iio/lsiio.c
diff options
context:
space:
mode:
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;