[PATCH] Input: atkbd - use __assign_bit() where applicable
From: Peng Fan (OSS)
Date: Sat Sep 19 2026 - 09:10:28 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/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