]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: asus: Replace magic number with HID_UP_ASUSVENDOR constant
authorIonut Nechita <ionut_n2001@yahoo.com>
Wed, 7 Jan 2026 15:42:18 +0000 (17:42 +0200)
committerJiri Kosina <jkosina@suse.com>
Thu, 8 Jan 2026 11:17:16 +0000 (12:17 +0100)
Use the existing HID_UP_ASUSVENDOR constant instead of the magic number
0xff310000 for better code clarity and maintainability.

Reviewed-by: Denis Benato <benato.denis96@gmail.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-asus.c

index a444d41e53b6c60a6fc5286f680a91c688d459f3..9a969f5c5c90e91c59b23ad2aeb38c880087933b 100644 (file)
@@ -316,7 +316,7 @@ static int asus_e1239t_event(struct asus_drvdata *drvdat, u8 *data, int size)
 static int asus_event(struct hid_device *hdev, struct hid_field *field,
                      struct hid_usage *usage, __s32 value)
 {
-       if ((usage->hid & HID_USAGE_PAGE) == 0xff310000 &&
+       if ((usage->hid & HID_USAGE_PAGE) == HID_UP_ASUSVENDOR &&
            (usage->hid & HID_USAGE) != 0x00 &&
            (usage->hid & HID_USAGE) != 0xff && !usage->type) {
                hid_warn(hdev, "Unmapped Asus vendor usagepage code 0x%02x\n",