Re: [PATCH] dax: use assign_bit() where applicable

From: Jonathan Cameron

Date: Mon Sep 21 2026 - 19:11:33 EST


On Mon, 21 Sep 2026 10:24:51 +0200
"Gupta, Pankaj" <pankaj.gupta@xxxxxxx> wrote:

> > [You don't often get email from peng.fan@xxxxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> >
> > From: Peng Fan <peng.fan@xxxxxxx>
> >
> > Convert open-coded if/else with set_bit/clear_bit to the assign_bit API.
> >
> > Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
>
> Reviewed-by: Pankaj Gupta <pankaj.gupta@xxxxxxx>

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@xxxxxxxxxxxxxxxx>

>
> > ---
> > 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
> >
> >
>