Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH] Input: atkbd - use __assign_bit() where applicable
@ 2026-09-19 13:07 Peng Fan (OSS)
  2026-09-21 22:55 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan (OSS) @ 2026-09-19 13:07 UTC (permalink / raw)
  To: Dmitry Torokhov, Cryolitia PukNgae, Kees Cook, Zeyu WANG,
	Hans de Goede, Ariel Silver, Donglin Lyu, Alexei Turtanov,
	Zhefu Zhang
  Cc: linux-kernel, Peng Fan, linux-input

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


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

* Re: [PATCH] Input: atkbd - use __assign_bit() where applicable
  2026-09-19 13:07 [PATCH] Input: atkbd - use __assign_bit() where applicable Peng Fan (OSS)
@ 2026-09-21 22:55 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2026-09-21 22:55 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: Cryolitia PukNgae, Kees Cook, Zeyu WANG, Hans de Goede,
	Ariel Silver, Donglin Lyu, Alexei Turtanov, Zhefu Zhang,
	linux-kernel, Peng Fan, linux-input

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

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

end of thread, other threads:[~2026-09-21 22:56 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:07 [PATCH] Input: atkbd - use __assign_bit() where applicable Peng Fan (OSS)
2026-09-21 22:55 ` Dmitry Torokhov

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