Skip to content

Commit b928908

Browse files
author
Jiri Kosina
committed
Merge branch 'for-6.15/core' into for-linus
- differentiate warning for reserved item tag from unknown item tag, in accordance to 6.2.2.4 from the HID specification 1.11 (Tatsuya S)
2 parents 5d28bc6 + c600a55 commit b928908

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/hid/hid-core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,11 @@ static int hid_parser_main(struct hid_parser *parser, struct hid_item *item)
657657
ret = hid_add_field(parser, HID_FEATURE_REPORT, data);
658658
break;
659659
default:
660-
hid_warn(parser->device, "unknown main item tag 0x%x\n", item->tag);
660+
if (item->tag >= HID_MAIN_ITEM_TAG_RESERVED_MIN &&
661+
item->tag <= HID_MAIN_ITEM_TAG_RESERVED_MAX)
662+
hid_warn(parser->device, "reserved main item tag 0x%x\n", item->tag);
663+
else
664+
hid_warn(parser->device, "unknown main item tag 0x%x\n", item->tag);
661665
ret = 0;
662666
}
663667

include/linux/hid.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ struct hid_item {
8181
#define HID_MAIN_ITEM_TAG_FEATURE 11
8282
#define HID_MAIN_ITEM_TAG_BEGIN_COLLECTION 10
8383
#define HID_MAIN_ITEM_TAG_END_COLLECTION 12
84+
#define HID_MAIN_ITEM_TAG_RESERVED_MIN 13
85+
#define HID_MAIN_ITEM_TAG_RESERVED_MAX 15
8486

8587
/*
8688
* HID report descriptor main item contents

0 commit comments

Comments
 (0)