From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
Tom Rix <trix@redhat.com>, <ntfs3@lists.linux.dev>,
<llvm@lists.linux.dev>, <patches@lists.linux.dev>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next v2 2/2] fs/ntfs3: Eliminate unnecessary ternary operator in ntfs_d_compare()
Date: Sat, 12 Nov 2022 21:11:10 +0300 [thread overview]
Message-ID: <b9ef96f3-724e-1696-3f22-d5e89cbd927d@paragon-software.com> (raw)
In-Reply-To: <20221004232359.285685-2-nathan@kernel.org>
On 10/5/22 02:23, Nathan Chancellor wrote:
> '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>
> ---
>
> v2: New patch.
>
> fs/ntfs3/namei.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c
> index 5d3a6ce3f05f..6b0d2c01d6ff 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;
Thank you for your work, applied!
First patch was already applied.
next prev parent reply other threads:[~2022-11-12 18:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 23:23 [PATCH -next v2 1/2] fs/ntfs3: Don't use uni1 uninitialized in ntfs_d_compare() Nathan Chancellor
2022-10-04 23:23 ` [PATCH -next v2 2/2] fs/ntfs3: Eliminate unnecessary ternary operator " Nathan Chancellor
2022-10-04 23:26 ` Nick Desaulniers
2022-11-12 18:11 ` Konstantin Komarov [this message]
2022-10-21 17:10 ` [PATCH -next v2 1/2] fs/ntfs3: Don't use uni1 uninitialized " Nathan Chancellor
2022-10-26 16:56 ` Konstantin Komarov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b9ef96f3-724e-1696-3f22-d5e89cbd927d@paragon-software.com \
--to=almaz.alexandrovich@paragon-software.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=ntfs3@lists.linux.dev \
--cc=patches@lists.linux.dev \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).