mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Thorsten Blum <thorsten.blum@toblux.com>
Cc: almaz.alexandrovich@paragon-software.com, ntfs3@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] fs/ntfs3: Use swap() to improve code
Date: Mon, 2 Sep 2024 17:37:24 +0300	[thread overview]
Message-ID: <9212714c-7f75-47da-bc34-48d775925194@stanley.mountain> (raw)
In-Reply-To: <041F9CBB-17E9-4D6F-B981-BC861E1048CB@toblux.com>

On Mon, Sep 02, 2024 at 04:26:16PM +0200, Thorsten Blum wrote:
> On 26. Aug 2024, at 12:39, Thorsten Blum <thorsten.blum@toblux.com> wrote:
> > 
> > Use the swap() macro to simplify the code and improve its readability.
> > 
> > Fixes the following Coccinelle/coccicheck warning reported by
> > swap.cocci:
> > 
> >  WARNING opportunity for swap()
> > 
> > Compile-tested only.
> > 
> > Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
> > ---
> > Changes in v2:
> > - Address kernel test robot feedback and assign match_offset as before
> > - Link to v1: https://lore.kernel.org/linux-kernel/20240731135403.80805-2-thorsten.blum@toblux.com/
> > ---
> > fs/ntfs3/lib/lzx_decompress.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/fs/ntfs3/lib/lzx_decompress.c b/fs/ntfs3/lib/lzx_decompress.c
> > index 6b16f07073c1..4d5701024f83 100644
> > --- a/fs/ntfs3/lib/lzx_decompress.c
> > +++ b/fs/ntfs3/lib/lzx_decompress.c
> > @@ -512,8 +512,7 @@ static int lzx_decompress_block(const struct lzx_decompressor *d,
> > * the same code.  (For R0, the swap is a no-op.)
> > */
> > match_offset = recent_offsets[offset_slot];
> > - recent_offsets[offset_slot] = recent_offsets[0];
> > - recent_offsets[0] = match_offset;
> > + swap(recent_offsets[offset_slot], recent_offsets[0]);
> > } else {
> > /* Explicit offset  */
> > 
> > -- 
> > 2.46.0
> > 
> 
> Hi Konstantin,
> 
> I just noticed that v1 of this patch is already in next (commit 
> 7495ce846bbe4f38d7ea5e023e44ad864b6348ad), but v2 fixes a possible bug 
> reported by kernel test robot (match_offset is still used later).
> 
> Could you take another look at it and apply v2 if possible?

The kbuild-bot only complained after the code was already merged.  Here is the
bug report:

https://lore.kernel.org/all/38752402-3a41-45f0-97ba-4f208d17337b@stanley.mountain/

I don't know if ntfs3 git tree rebases, but generally the advice we would give
would be to assume it isn't and write a Fixes commit which can be applied on
top instead of a v2.  If it's a rebase tree, the maintainer will know how to
fold the two patches together.

Thanks for following up on this.

regards,
dan carpenter


      reply	other threads:[~2024-09-02 14:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-26 10:39 Thorsten Blum
2024-09-02 14:26 ` Thorsten Blum
2024-09-02 14:37   ` Dan Carpenter [this message]

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=9212714c-7f75-47da-bc34-48d775925194@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    --cc=thorsten.blum@toblux.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

all inboxes | Powered by JetHome®