From: Peng Fan <peng.fan@oss.nxp.com>
To: Alison Schofield <alison.schofield@intel.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
"Gupta, Pankaj" <pankaj.gupta@amd.com>,
Dan Williams <djbw@kernel.org>,
Vishal Verma <vishal.l.verma@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>,
nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org
Subject: Re: [PATCH] dax: use assign_bit() where applicable
Date: Thu, 8 Oct 2026 11:00:40 +0800 [thread overview]
Message-ID: <ascHWPHVlaeH0/pi@shlinux89> (raw)
In-Reply-To: <asb5FDTzTHyayd6U@aschofie-mobl2.lan>
Hi Alison,
On Wed, Oct 07, 2026 at 06:59:48PM -0700, Alison Schofield wrote:
>On Tue, Sep 22, 2026 at 12:08:13AM +0100, Jonathan Cameron wrote:
>> On Mon, 21 Sep 2026 10:24:51 +0200
>> "Gupta, Pankaj" <pankaj.gupta@amd.com> wrote:
>>
>> > > [You don't often get email from peng.fan@oss.nxp.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>> > >
>> > > From: Peng Fan <peng.fan@nxp.com>
>> > >
>> > > Convert open-coded if/else with set_bit/clear_bit to the assign_bit API.
>> > >
>> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> >
>> > Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
>>
>> A bit marginal wrt to churn but a good change in general.
>> Up to DAX maintainers on whether they want this type of small
>> focused improvement.
>
>I didn't see the improvement. When I peruse the file I see set_bit and
>clear_bit, and now I see a couple of those obfuscated by a new
>assign_bit, needlessly.
>
>If Peng wants to come back around with a 'why' then I'd take another
>look. I shared my NAK story here:
>
>https://lore.kernel.org/lkml/asb3hGpSWVQk93cX@aschofie-mobl2.lan/
Thanks for taking the time to explain, and for the link to your
earlier reply - that was useful context.
This patch was done by a cocci rule.
sorry for not providing a justification for this particular conversion or
making the intent clearer. Converting only some of the call sites leaves the
file with a mix of styles.
Free to drop the patch.
Thanks
Peng
>
>
>>
>> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
>>
>> >
>> > > ---
>> > > drivers/dax/super.c | 5 +----
>> > > 1 file changed, 1 insertion(+), 4 deletions(-)
>> > >
>> > > diff --git a/drivers/dax/super.c b/drivers/dax/super.c
>> > > index 45f84b0eb909..60c4aec52ae1 100644
>> > > --- a/drivers/dax/super.c
>> > > +++ b/drivers/dax/super.c
>> > > @@ -385,10 +385,7 @@ EXPORT_SYMBOL_GPL(dax_flush);
>> > >
>> > > void dax_write_cache(struct dax_device *dax_dev, bool wc)
>> > > {
>> > > - if (wc)
>> > > - set_bit(DAXDEV_WRITE_CACHE, &dax_dev->flags);
>> > > - else
>> > > - clear_bit(DAXDEV_WRITE_CACHE, &dax_dev->flags);
>> > > + assign_bit(DAXDEV_WRITE_CACHE, &dax_dev->flags, wc);
>> > > }
>> > > EXPORT_SYMBOL_GPL(dax_write_cache);
>> > >
>> > > --
>> > > 2.51.0
>> > >
>> > >
>> >
>>
>
next prev parent reply other threads:[~2026-10-08 2:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 13:07 Peng Fan (OSS)
2026-09-21 8:24 ` Gupta, Pankaj
2026-09-21 23:08 ` Jonathan Cameron
2026-10-08 1:59 ` Alison Schofield
2026-10-08 3:00 ` Peng Fan [this message]
2026-09-21 23:10 ` Dave Jiang
2026-10-08 2:02 ` Alison Schofield
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=ascHWPHVlaeH0/pi@shlinux89 \
--to=peng.fan@oss.nxp.com \
--cc=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=djbw@kernel.org \
--cc=jic23@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=pankaj.gupta@amd.com \
--cc=peng.fan@nxp.com \
--cc=vishal.l.verma@intel.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®