mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] target: use assign_bit() where applicable
@ 2026-09-19 13:08 Peng Fan (OSS)
  2026-09-21 10:58 ` Bodo Strößer
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan (OSS) @ 2026-09-19 13:08 UTC (permalink / raw)
  To: Bodo Stroesser, Martin K. Petersen
  Cc: linux-kernel, Peng Fan, linux-scsi, target-devel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] target: use assign_bit() where applicable
  2026-09-19 13:08 [PATCH] target: use assign_bit() where applicable Peng Fan (OSS)
@ 2026-09-21 10:58 ` Bodo Strößer
  0 siblings, 0 replies; 2+ messages in thread
From: Bodo Strößer @ 2026-09-21 10:58 UTC (permalink / raw)
  To: Peng Fan (OSS), Martin K. Petersen
  Cc: linux-kernel, Peng Fan, linux-scsi, target-devel

On 19/09/2026 15:08, 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>
> ---
>   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);
Reviewed-by: Bodo Stroesser<bostroesser@gmail.com>

Best regards,
Bodo Strößer

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-21 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-19 13:08 [PATCH] target: use assign_bit() where applicable Peng Fan (OSS)
2026-09-21 10:58 ` Bodo Strößer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®