[PATCH 05/13] libblkid: simplify if clause [oclint]

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

 



Move negative and positive testing of 'has' variable to top level, and test
flag bit mask on second level.  This way the 'has' needs to be checked only
once.

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 libblkid/src/probe.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index d7a3ba7..43ea4c7 100644
--- a/libblkid/src/probe.c
+++ b/libblkid/src/probe.c
@@ -552,13 +552,11 @@ int __blkid_probe_filter_types(blkid_probe pr, int chain, int flag, char *names[
 				break;
 			}
 		}
-		if (flag & BLKID_FLTR_ONLYIN) {
-		       if (!has)
+		if (has) {
+			if (flag & BLKID_FLTR_NOTIN)
 				blkid_bmp_set_item(fltr, i);
-		} else if (flag & BLKID_FLTR_NOTIN) {
-			if (has)
-				blkid_bmp_set_item(fltr, i);
-		}
+		} else if (flag & BLKID_FLTR_ONLYIN)
+			blkid_bmp_set_item(fltr, i);
 	}
 
 	DBG(LOWPROBE, ul_debug("%s: a new probing type-filter initialized",
-- 
2.9.0

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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