From: Boris Egorov Date: Fri, 19 Jun 2015 19:41:00 +0000 (+0600) Subject: libblkid/whereis: simplify some conditions [cppcheck] X-Git-Tag: v2.27-rc1~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7508d991c5ee23a4dbc790deda306deba1a69cf4;p=thirdparty%2Futil-linux.git libblkid/whereis: simplify some conditions [cppcheck] [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 --- diff --git a/libblkid/src/tag.c b/libblkid/src/tag.c index 6af8062510..281612a7a9 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 96a930e602..697d66626d 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; }