[PATCH] mtd: cfi_cmdset_0001: use assign_bit() where applicable

Peng Fan (OSS) posted 1 patch 5 days, 8 hours ago
drivers/mtd/chips/cfi_cmdset_0001.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[PATCH] mtd: cfi_cmdset_0001: use assign_bit() where applicable
Posted by Peng Fan (OSS) 5 days, 8 hours ago
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/mtd/chips/cfi_cmdset_0001.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index 60d82a1acb01..e5805eebeed6 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -2520,10 +2520,7 @@ static void cfi_intelext_save_locks(struct mtd_info *mtd)
 
 			status = cfi_varsize_frob(mtd,
 					do_getlockstatus_oneblock, adr, len, NULL);
-			if (status)
-				set_bit(block, region->lockmap);
-			else
-				clear_bit(block, region->lockmap);
+			assign_bit(block, region->lockmap, status);
 		}
 	}
 }
-- 
2.51.0
Re: [PATCH] mtd: cfi_cmdset_0001: use assign_bit() where applicable
Posted by Breno Leitao 3 days, 13 hours ago
On Sat, Sep 19, 2026 at 09:08:06PM +0800, 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: Breno Leitao <leitao@debian.org>