From: Sami Kerola Date: Tue, 15 May 2018 19:14:05 +0000 (+0100) Subject: mountpoint: simplify test condition [cppcheck] X-Git-Tag: v2.33-rc1~236 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d69fd437ac2c4c0e193c52bbb65f515d2f6f363;p=thirdparty%2Futil-linux.git 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 --- diff --git a/sys-utils/mountpoint.c b/sys-utils/mountpoint.c index 808cfb9d0d..00a74daf03 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; }