fs/ntfs3: Eliminate unnecessary ternary operator in ntfs_d_compare()
authorNathan Chancellor <nathan@kernel.org>
Tue, 4 Oct 2022 23:23:59 +0000 (16:23 -0700)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Sat, 12 Nov 2022 17:59:42 +0000 (20:59 +0300)
'a == b ? 0 : 1' is logically equivalent to 'a != b'.

Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/namei.c

index 5d3a6ce..6b0d2c0 100644 (file)
@@ -432,7 +432,7 @@ static int ntfs_d_compare(const struct dentry *dentry, unsigned int len1,
        /* First try fast implementation. */
        for (;;) {
                if (!lm--)
-                       return len1 == len2 ? 0 : 1;
+                       return len1 != len2;
 
                if ((c1 = *n1++) == (c2 = *n2++))
                        continue;