[PATCH] rxrpc: use assign_bit() where applicable

Simon Horman horms at kernel.org
Mon Sep 21 09:23:28 PDT 2026


On Sun, Sep 20, 2026 at 10:27:52AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan at nxp.com>
> 
> Convert open-coded if/else with set_bit/clear_bit 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);
> 
>     @@
>     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 at nxp.com>

Reviewed-by: Simon Horman <horms at kernel.org>




More information about the linux-afs mailing list