]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mountpoint: simplify test condition [cppcheck]
authorSami Kerola <kerolasa@iki.fi>
Tue, 15 May 2018 19:14:05 +0000 (20:14 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 28 May 2018 11:39:18 +0000 (13:39 +0200)
[sys-utils/mountpoint.c:79]: (style) Redundant condition:
ctl->st.st_dev==pst.st_dev. 'A || (!A && B)' is equivalent to 'A || B'

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/mountpoint.c

index 808cfb9d0dcb850b09c97692a39bb4edaafccbe5..00a74daf03f6ec0e1939a377a9808d96e36dc5c4 100644 (file)
@@ -76,8 +76,7 @@ static int dir_to_device(struct mountpoint_control *ctl)
                if (stat(buf, &pst) !=0)
                        return -1;
 
-               if ((ctl->st.st_dev != pst.st_dev) ||
-                   (ctl->st.st_dev == pst.st_dev && ctl->st.st_ino == pst.st_ino)) {
+               if (ctl->st.st_dev != pst.st_dev || ctl->st.st_ino == pst.st_ino) {
                        ctl->dev = ctl->st.st_dev;
                        return 0;
                }