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>
This commit is contained in:
Cristina Opriceana
2015-07-13 16:15:56 +03:00
committed by Jonathan Cameron
parent 8ab6abfca0
commit ff1ac639b3
3 changed files with 35 additions and 35 deletions

View File

@@ -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;