summaryrefslogtreecommitdiffstats
path: root/libblkid/src/probe.c
diff options
context:
space:
mode:
authorSami Kerola2016-07-04 23:12:55 +0200
committerSami Kerola2016-07-21 22:14:33 +0200
commit92a4d098ce12994756c3a0527786609a83947224 (patch)
treebb48c64753a377d2cfc353ddb7a71b0b54eabb96 /libblkid/src/probe.c
parentlslogins: simplify if clause and move definition and comments [oclint] (diff)
downloadkernel-qcow2-util-linux-92a4d098ce12994756c3a0527786609a83947224.tar.gz
kernel-qcow2-util-linux-92a4d098ce12994756c3a0527786609a83947224.tar.xz
kernel-qcow2-util-linux-92a4d098ce12994756c3a0527786609a83947224.zip
libblkid: simplify if clause [oclint]
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@iki.fi>
Diffstat (limited to 'libblkid/src/probe.c')
-rw-r--r--libblkid/src/probe.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index d7a3ba7cf..43ea4c741 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",