From: Nathan Chancellor Date: Tue, 4 Oct 2022 23:23:59 +0000 (-0700) Subject: fs/ntfs3: Eliminate unnecessary ternary operator in ntfs_d_compare() X-Git-Tag: v6.2-rc1~22^2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75b5e47201329537c8b88531a59aab2cbcec8d61;p=thirdparty%2Fkernel%2Fstable.git fs/ntfs3: Eliminate unnecessary ternary operator in ntfs_d_compare() 'a == b ? 0 : 1' is logically equivalent to 'a != b'. Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Konstantin Komarov --- diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index 5d3a6ce3f05f4..6b0d2c01d6ffc 100644 --- a/fs/ntfs3/namei.c +++ b/fs/ntfs3/namei.c @@ -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;