Linux Input/HID development
 help / color / mirror / Atom feed
From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Cryolitia PukNgae <cryolitia.pukngae@linux.dev>,
	Kees Cook <kees+treewide@kernel.org>,
	Zeyu WANG <zeyu.thomas.wang@gmail.com>,
	Hans de Goede <hansg@kernel.org>,
	Ariel Silver <arielsilver77@gmail.com>,
	Donglin Lyu <DongLin_Lyu@outlook.com>,
	Alexei Turtanov <9alexei9@gmail.com>,
	Zhefu Zhang <a723356@gmail.com>
Cc: linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>,
	linux-input@vger.kernel.org
Subject: [PATCH] Input: atkbd - use __assign_bit() where applicable
Date: Sat, 19 Sep 2026 21:07:36 +0800	[thread overview]
Message-ID: <20260919130741.3041442-1-peng.fan@oss.nxp.com> (raw)

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


             reply	other threads:[~2026-09-19 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 13:07 Peng Fan (OSS) [this message]
2026-09-21 22:55 ` [PATCH] Input: atkbd - use __assign_bit() where applicable Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260919130741.3041442-1-peng.fan@oss.nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=9alexei9@gmail.com \
    --cc=DongLin_Lyu@outlook.com \
    --cc=a723356@gmail.com \
    --cc=arielsilver77@gmail.com \
    --cc=cryolitia.pukngae@linux.dev \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hansg@kernel.org \
    --cc=kees+treewide@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=zeyu.thomas.wang@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox