[PATCH] Input: atkbd - use __assign_bit() where applicable

Peng Fan (OSS) posted 1 patch 5 days, 8 hours ago
drivers/input/keyboard/atkbd.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[PATCH] Input: atkbd - 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/input/keyboard/atkbd.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 93650c98206d..aad331914589 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -357,10 +357,7 @@ static void atkbd_calculate_xl_bit(struct atkbd *atkbd, u8 code)
 
 	for (i = 0; i < ARRAY_SIZE(xl_table); i++) {
 		if (!((code ^ xl_table[i]) & 0x7f)) {
-			if (code & 0x80)
-				__clear_bit(i, &atkbd->xl_bit);
-			else
-				__set_bit(i, &atkbd->xl_bit);
+			__assign_bit(i, &atkbd->xl_bit, !(code & 0x80));
 			break;
 		}
 	}
-- 
2.51.0
Re: [PATCH] Input: atkbd - use __assign_bit() where applicable
Posted by Dmitry Torokhov 2 days, 22 hours ago
On Sat, Sep 19, 2026 at 09:07:36PM +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>

Applied, thank you.

-- 
Dmitry