From: "yu kuai" <yukuai@fygo.io>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
"Song Liu" <song@kernel.org>,
"Li Nan" <magiclinan@didiglobal.com>,
"Xiao Ni" <xiao@kernel.org>, "yu kuai" <yukuai@fygo.io>
Cc: <linux-kernel@vger.kernel.org>, "Peng Fan" <peng.fan@nxp.com>,
<linux-raid@vger.kernel.org>
Subject: Re: [Patch V2] md/raid: use assign_bit() where applicable
Date: Wed, 23 Sep 2026 19:15:43 +0800 [thread overview]
Message-ID: <f46a226a-6c7b-4a50-99f7-40400fb377db@fygo.io> (raw)
In-Reply-To: <20260921081009.278532-2-peng.fan@oss.nxp.com>
在 2026/9/21 16:10, Peng Fan (OSS) 写道:
> From: Peng Fan<peng.fan@nxp.com>
>
> Convert open-coded if/else with set_bit/clear_bit to the assign_bit API.
>
> Done with Coccinelle semantic patch:
> // set_bit -> clear_bit => assign_bit
>
> @@
> expression cond, bit, addr;
> @@
>
> -if (cond)
> - set_bit(bit, addr);
> -else
> - clear_bit(bit, addr);
> +assign_bit(bit, addr, cond);
>
> // clear_bit -> set_bit => assign_bit
>
> @@
> expression cond, bit, addr;
> @@
>
> -if (cond)
> - clear_bit(bit, addr);
> -else
> - set_bit(bit, addr);
> +assign_bit(bit, addr, !cond);
>
> Signed-off-by: Peng Fan<peng.fan@nxp.com>
> ---
>
> V2:
> Separate device-mapper and mraid
> https://lore.kernel.org/all/20260918141737.3023011-1-peng.fan@oss.nxp.com/
>
> drivers/md/md.c | 22 ++++++----------------
> drivers/md/raid5-cache.c | 6 ++----
> drivers/md/raid5.c | 6 ++----
> 3 files changed, 10 insertions(+), 24 deletions(-)
Applied to md-7.4
--
Thanks,
Kuai
next prev parent reply other threads:[~2026-09-23 11:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 8:10 [Patch V2] dm: " Peng Fan (OSS)
2026-09-21 8:10 ` [Patch V2] md/raid: " Peng Fan (OSS)
2026-09-23 11:15 ` yu kuai [this message]
2026-09-21 14:16 ` [Patch V2] dm: " Mikulas Patocka
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=f46a226a-6c7b-4a50-99f7-40400fb377db@fygo.io \
--to=yukuai@fygo.io \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=magiclinan@didiglobal.com \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=song@kernel.org \
--cc=xiao@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®