Skip to contentSkip to conversation

HID: Fix debug name for BTN_GEAR_DOWN, BTN_GEAR_UP, BTN_WHEEL

PATCH Applied Vicki Pfau 3 participants 4 messages Jul 2, 2025 – Jul 10, 2025 HID

lore
Share & tools
lore

Vicki Pfau

author
#0 lore raw

PATCH 1/1 HID: Fix debug name for BTN_GEAR_DOWN, BTN_GEAR_UP, BTN_WHEEL

The name of BTN_GEAR_DOWN was WheelBtn and BTN_WHEEL was missing. Further, BTN_GEAR_UP had a space in its name and no Btn, which is against convention. This makes the names BtnGearDown, BtnGearUp, and BtnWheel, fixing the errors and matching convention.

---
 drivers/hid/hid-debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-debug.c +2 -2
index 8433306148d5..c6b6b1029540 100644
@@ -3298,8 +3298,8 @@ static const char *keys[KEY_MAX + 1] = {
 	[BTN_TOUCH] = "Touch",			[BTN_STYLUS] = "Stylus",
 	[BTN_STYLUS2] = "Stylus2",		[BTN_TOOL_DOUBLETAP] = "ToolDoubleTap",
 	[BTN_TOOL_TRIPLETAP] = "ToolTripleTap",	[BTN_TOOL_QUADTAP] = "ToolQuadrupleTap",
-	[BTN_GEAR_DOWN] = "WheelBtn",
-	[BTN_GEAR_UP] = "Gear up",		[KEY_OK] = "Ok",
+	[BTN_GEAR_DOWN] = "BtnGearDown",	[BTN_GEAR_UP] = "BtnGearUp",
+	[BTN_WHEEL] = "BtnWheel",		[KEY_OK] = "Ok",
 	[KEY_SELECT] = "Select",		[KEY_GOTO] = "Goto",
 	[KEY_CLEAR] = "Clear",			[KEY_POWER2] = "Power2",
 	[KEY_OPTION] = "Option",		[KEY_INFO] = "Info",
Signature · 1 line
2.49.0
maintainer Applied
#1 lore raw
Quoted 6 lines · Vicki Pfau

The name of BTN_GEAR_DOWN was WheelBtn and BTN_WHEEL was missing. Further, BTN_GEAR_UP had a space in its name and no Btn, which is against convention. This makes the names BtnGearDown, BtnGearUp, and BtnWheel, fixing the errors and matching convention.

Applied to hid.git#for-6.16/upstream-fixes. Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#2 lore raw
Quoted 10 lines · Jiri Kosina
Quoted 6 lines · Vicki Pfau

The name of BTN_GEAR_DOWN was WheelBtn and BTN_WHEEL was missing. Further, BTN_GEAR_UP had a space in its name and no Btn, which is against convention. This makes the names BtnGearDown, BtnGearUp, and BtnWheel, fixing the errors and matching convention.

Applied to hid.git#for-6.16/upstream-fixes. Thanks,

Too quick. This breaks the build.

drivers/hid/hid-debug.c:3302:16: error: initializer overrides prior initialization of this subobject [-Werror,-Winitializer-overrides]
3302 | [BTN_WHEEL] = "BtnWheel", [KEY_OK] = "Ok",

      |                       ^~~~~~~~~~
drivers/hid/hid-debug.c:3301:20: note: previous initialization is here
 3301 |         [BTN_GEAR_DOWN] = "BtnGearDown",        [BTN_GEAR_UP] = "BtnGearUp",
      |                           ^~~~~~~~~~~~~

1 error generated.

Please, guys, always test your builds with make W=1 (when CONFIG_WERROR is not dropped) and with GCC and clang.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
In reply to Vicki Pfau
Quoted 1 line · Vicki Pfau

The name of BTN_GEAR_DOWN was WheelBtn and BTN_WHEEL was missing.

Not true. Please, read code better.

Quoted 4 lines

Further,
BTN_GEAR_UP had a space in its name and no Btn, which is against convention. This makes the names BtnGearDown, BtnGearUp, and BtnWheel, fixing the errors and matching convention.

Signature · 2 lines
With Best Regards,
Andy Shevchenko