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

From: Alison Schofield

Date: Wed Oct 07 2026 - 22:02:34 EST


On Sat, Sep 19, 2026 at 09:07:50PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@xxxxxxx>
>
> Convert open-coded if/else with set_bit/clear_bit to the assign_bit API.


NAK

See also:
https://lore.kernel.org/lkml/asb3hGpSWVQk93cX@xxxxxxxxxxxxxxxxxx/

>
> Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
> ---
> 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
>
>