* [PATCH] dax: use assign_bit() where applicable
@ 2026-09-19 13:07 Peng Fan (OSS)
2026-09-21 8:24 ` Gupta, Pankaj
2026-09-21 23:10 ` Dave Jiang
0 siblings, 2 replies; 4+ messages in thread
From: Peng Fan (OSS) @ 2026-09-19 13:07 UTC (permalink / raw)
To: Dan Williams, Vishal Verma, Dave Jiang, Alison Schofield
Cc: linux-kernel, Peng Fan, nvdimm, linux-cxl
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>
---
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dax: use assign_bit() where applicable
2026-09-19 13:07 [PATCH] dax: use assign_bit() where applicable Peng Fan (OSS)
@ 2026-09-21 8:24 ` Gupta, Pankaj
2026-09-21 23:08 ` Jonathan Cameron
2026-09-21 23:10 ` Dave Jiang
1 sibling, 1 reply; 4+ messages in thread
From: Gupta, Pankaj @ 2026-09-21 8:24 UTC (permalink / raw)
To: Peng Fan (OSS), Dan Williams, Vishal Verma, Dave Jiang, Alison Schofield
Cc: linux-kernel, Peng Fan, nvdimm, linux-cxl
> [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>
> ---
> 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
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dax: use assign_bit() where applicable
2026-09-21 8:24 ` Gupta, Pankaj
@ 2026-09-21 23:08 ` Jonathan Cameron
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2026-09-21 23:08 UTC (permalink / raw)
To: Gupta, Pankaj
Cc: Peng Fan (OSS),
Dan Williams, Vishal Verma, Dave Jiang, Alison Schofield,
linux-kernel, Peng Fan, nvdimm, linux-cxl
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.
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
> >
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dax: use assign_bit() where applicable
2026-09-19 13:07 [PATCH] dax: use assign_bit() where applicable Peng Fan (OSS)
2026-09-21 8:24 ` Gupta, Pankaj
@ 2026-09-21 23:10 ` Dave Jiang
1 sibling, 0 replies; 4+ messages in thread
From: Dave Jiang @ 2026-09-21 23:10 UTC (permalink / raw)
To: Peng Fan (OSS), Dan Williams, Vishal Verma, Alison Schofield
Cc: linux-kernel, Peng Fan, nvdimm, linux-cxl
On 9/19/26 6:07 AM, Peng Fan (OSS) wrote:
> 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: Dave Jiang <dave.jiang@intel.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);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-21 23:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-19 13:07 [PATCH] dax: use assign_bit() where applicable Peng Fan (OSS)
2026-09-21 8:24 ` Gupta, Pankaj
2026-09-21 23:08 ` Jonathan Cameron
2026-09-21 23:10 ` Dave Jiang
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®