From: Andreas Larsson <andreas@gaisler.com>
To: Thorsten Blum <thorsten.blum@toblux.com>,
"David S. Miller" <davem@davemloft.net>
Cc: Rob Herring <robh@kernel.org>, Sam Ravnborg <sam@ravnborg.org>,
sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sparc: Use swap() to fix Coccinelle warning
Date: Mon, 22 Apr 2024 16:43:32 +0200 [thread overview]
Message-ID: <e9dbc4ac-7724-4565-a1d1-ddf19a6488f8@gaisler.com> (raw)
In-Reply-To: <20240404112313.11898-2-thorsten.blum@toblux.com>
On 2024-04-04 13:23, Thorsten Blum wrote:
> Fixes the following Coccinelle/coccicheck warning reported by
> swap.cocci:
>
> WARNING opportunity for swap()
>
> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
> ---
> arch/sparc/include/asm/floppy_64.h | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/sparc/include/asm/floppy_64.h b/arch/sparc/include/asm/floppy_64.h
> index 6efeb24b0a92..83decacd0a2d 100644
> --- a/arch/sparc/include/asm/floppy_64.h
> +++ b/arch/sparc/include/asm/floppy_64.h
> @@ -704,9 +704,7 @@ static unsigned long __init sun_floppy_init(void)
> ns87303_modify(config, ASC, ASC_DRV2_SEL, 0);
> ns87303_modify(config, FCR, 0, FCR_LDE);
>
> - config = sun_floppy_types[0];
> - sun_floppy_types[0] = sun_floppy_types[1];
> - sun_floppy_types[1] = config;
> + swap(sun_floppy_types[0], sun_floppy_types[1]);
>
> if (sun_pci_broken_drive != -1) {
> sun_pci_broken_drive = 1 - sun_pci_broken_drive;
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Picking this up to my for-next
Thanks,
Andreas
prev parent reply other threads:[~2024-04-22 14:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-04 11:23 [PATCH] sparc: Use swap() to fix Coccinelle warning Thorsten Blum
2024-04-22 14:43 ` Andreas Larsson [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=e9dbc4ac-7724-4565-a1d1-ddf19a6488f8@gaisler.com \
--to=andreas@gaisler.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sam@ravnborg.org \
--cc=sparclinux@vger.kernel.org \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).