[PATCH 2/3] libblkid/whereis: simplify some conditions [cppcheck]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[misc-utils/whereis.c:466]: (style) Redundant condition: uflag.
'A && (!A || B)' is equivalent to 'A || B'
[libblkid/src/tag.c:373]: (style) Redundant condition: dev.
'A && (!A || B)' is equivalent to 'A || B'

Signed-off-by: Boris Egorov <egorov@xxxxxxxxx>
---
 libblkid/src/tag.c   | 2 +-
 misc-utils/whereis.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libblkid/src/tag.c b/libblkid/src/tag.c
index 6af8062..281612a 100644
--- a/libblkid/src/tag.c
+++ b/libblkid/src/tag.c
@@ -370,7 +370,7 @@ try_again:
 	}
 	if (dev && !(dev->bid_flags & BLKID_BID_FL_VERIFIED)) {
 		dev = blkid_verify(cache, dev);
-		if (!dev || (dev && (dev->bid_flags & BLKID_BID_FL_VERIFIED)))
+		if (!dev || dev->bid_flags & BLKID_BID_FL_VERIFIED)
 			goto try_again;
 	}
 
diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c
index 96a930e..697d666 100644
--- a/misc-utils/whereis.c
+++ b/misc-utils/whereis.c
@@ -463,7 +463,7 @@ static void lookup(const char *pattern, struct wh_dirlist *ls, int want)
 
 	free(wait);
 
-	if (!uflag || (uflag && count > 1))
+	if (!uflag || count > 1)
 		putchar('\n');
 	return;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux