Skip to contentSkip to conversation

HID: Fix the bit shift number for LED_KANA.

PATCH In review junan 2 participants 2 messages Nov 28, 2024 – Feb 3, 2025

Subsystems (3)
lore
Share & tools
lore

junan

author
#0 lore raw

PATCH 1/1 HID: Fix the bit shift number for LED_KANA.

Since "LED_KANA" was defined as "0x04", the shift number should be "4".

---
 drivers/hid/usbhid/usbkbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/usbhid/usbkbd.c +1 -1
index c439ed2f16db..af6bc76dbf64 100644
@@ -160,7 +160,7 @@ static int usb_kbd_event(struct input_dev *dev, unsigned int type,
 		return -1;
 
 	spin_lock_irqsave(&kbd->leds_lock, flags);
-	kbd->newleds = (!!test_bit(LED_KANA,    dev->led) << 3) | (!!test_bit(LED_COMPOSE, dev->led) << 3) |
+	kbd->newleds = (!!test_bit(LED_KANA,    dev->led) << 4) | (!!test_bit(LED_COMPOSE, dev->led) << 3) |
 		       (!!test_bit(LED_SCROLLL, dev->led) << 2) | (!!test_bit(LED_CAPSL,   dev->led) << 1) |
 		       (!!test_bit(LED_NUML,    dev->led));
 
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 1 line · junan

Since "LED_KANA" was defined as "0x04", the shift number should be "4".

Heh, this bug has been there for _*AGES*_, and it's a pretty obscure driver anyway. Let's fix it though, thanks. Applied.

Signature · 2 lines
Jiri Kosina
SUSE Labs