summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Kerola2018-05-15 21:14:05 +0200
committerKarel Zak2018-05-28 13:39:18 +0200
commit8d69fd437ac2c4c0e193c52bbb65f515d2f6f363 (patch)
treef27c7feda95d8082e471d6b5619bd43b2e0880b8
parentinclude/pt-mbr.h: fix integer overflow (diff)
downloadkernel-qcow2-util-linux-8d69fd437ac2c4c0e193c52bbb65f515d2f6f363.tar.gz
kernel-qcow2-util-linux-8d69fd437ac2c4c0e193c52bbb65f515d2f6f363.tar.xz
kernel-qcow2-util-linux-8d69fd437ac2c4c0e193c52bbb65f515d2f6f363.zip
mountpoint: simplify test condition [cppcheck]
[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>
-rw-r--r--sys-utils/mountpoint.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys-utils/mountpoint.c b/sys-utils/mountpoint.c
index 808cfb9d0..00a74daf0 100644
--- a/sys-utils/mountpoint.c
+++ b/sys-utils/mountpoint.c
@@ -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;
}