[PATCH] target: use assign_bit() where applicable

From: Peng Fan (OSS)

Date: Sat Sep 19 2026 - 09:12:04 EST


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>
---
drivers/target/target_core_user.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index edc2afd5f4ee..425ad1246a75 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -3006,10 +3006,7 @@ static ssize_t tcmu_tmr_notification_store(struct config_item *item,
if (val > 1)
return -EINVAL;

- if (val)
- set_bit(TCMU_DEV_BIT_TMR_NOTIFY, &udev->flags);
- else
- clear_bit(TCMU_DEV_BIT_TMR_NOTIFY, &udev->flags);
+ assign_bit(TCMU_DEV_BIT_TMR_NOTIFY, &udev->flags, val);
return count;
}
CONFIGFS_ATTR(tcmu_, tmr_notification);
--
2.51.0