From: Aubin Constans <aubin.constans@microchip.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
Ulf Hansson <ulfh@kernel.org>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
Kees Cook <kees@kernel.org>, Peng Fan <peng.fan@nxp.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-mmc@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] mmc: use assign_bit() where applicable
Date: Fri, 18 Sep 2026 20:22:54 +0200 [thread overview]
Message-ID: <70fd2e40-ddc1-4e80-9c4b-cf2fa9c3929e@microchip.com> (raw)
In-Reply-To: <20260918141810.3023069-1-peng.fan@oss.nxp.com>
On 18/09/2026 16:18, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Convert open-coded if/else with set_bit/clear_bit and their
> non-atomic __set_bit/__clear_bit variants to the assign_bit/__assign_bit
> API.
>
> Done with Coccinelle semantic patch and manual fixups.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> drivers/mmc/host/atmel-mci.c | 5 +----
Acked-by: Aubin Constans <aubin.constans@microchip.com>
> drivers/mmc/host/ushc.c | 5 +----
> 2 files changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index 8f4df250a77a..98933be5f174 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -1677,10 +1677,7 @@ static void atmci_detect_change(struct timer_list *t)
>
> spin_lock(&host->lock);
>
> - if (!present)
> - clear_bit(ATMCI_CARD_PRESENT, &slot->flags);
> - else
> - set_bit(ATMCI_CARD_PRESENT, &slot->flags);
> + assign_bit(ATMCI_CARD_PRESENT, &slot->flags, present);
>
> /* Clean up queue if present */
> mrq = slot->mrq;
> diff --git a/drivers/mmc/host/ushc.c b/drivers/mmc/host/ushc.c
> index 7e8af5a06ac9..410e5bb62752 100644
> --- a/drivers/mmc/host/ushc.c
> +++ b/drivers/mmc/host/ushc.c
> @@ -388,10 +388,7 @@ static void ushc_enable_sdio_irq(struct mmc_host *mmc, int enable)
> {
> struct ushc_data *ushc = mmc_priv(mmc);
>
> - if (enable)
> - set_bit(INT_EN, &ushc->flags);
> - else
> - clear_bit(INT_EN, &ushc->flags);
> + assign_bit(INT_EN, &ushc->flags, enable);
> }
>
> static void ushc_clean_up(struct ushc_data *ushc)
> --
> 2.51.0
>
prev parent reply other threads:[~2026-09-18 18:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 14:18 Peng Fan (OSS)
2026-09-18 18:22 ` Aubin Constans [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=70fd2e40-ddc1-4e80-9c4b-cf2fa9c3929e@microchip.com \
--to=aubin.constans@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=kees@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=ulfh@kernel.org \
/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®