* [PATCH] HID: Add reserved item tag for main items
@ 2024-09-26 7:25 Tatsuya S
2024-11-06 13:51 ` Jiri Kosina
0 siblings, 1 reply; 3+ messages in thread
From: Tatsuya S @ 2024-09-26 7:25 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires; +Cc: Tatsuya S, linux-input, linux-kernel
For main items, separate warning of reserved item tag from
warning of unknown item tag.
---
drivers/hid/hid-core.c | 6 +++++-
include/linux/hid.h | 2 ++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 30de92d0bf0f..1793edb6239d 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -629,7 +629,11 @@ static int hid_parser_main(struct hid_parser *parser, struct hid_item *item)
ret = hid_add_field(parser, HID_FEATURE_REPORT, data);
break;
default:
- hid_warn(parser->device, "unknown main item tag 0x%x\n", item->tag);
+ if (item->tag >= HID_MAIN_ITEM_TAG_RESERVED_MIN &&
+ item->tag <= HID_MAIN_ITEM_TAG_RESERVED_MAX)
+ hid_warn(parser->device, "reserved main item tag 0x%x\n", item->tag);
+ else
+ hid_warn(parser->device, "unknown main item tag 0x%x\n", item->tag);
ret = 0;
}
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 121d5b8bc867..e3894f38bd96 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -81,6 +81,8 @@ struct hid_item {
#define HID_MAIN_ITEM_TAG_FEATURE 11
#define HID_MAIN_ITEM_TAG_BEGIN_COLLECTION 10
#define HID_MAIN_ITEM_TAG_END_COLLECTION 12
+#define HID_MAIN_ITEM_TAG_RESERVED_MIN 13
+#define HID_MAIN_ITEM_TAG_RESERVED_MAX 15
/*
* HID report descriptor main item contents
--
2.46.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] HID: Add reserved item tag for main items
2024-09-26 7:25 [PATCH] HID: Add reserved item tag for main items Tatsuya S
@ 2024-11-06 13:51 ` Jiri Kosina
2024-11-07 5:38 ` t s
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2024-11-06 13:51 UTC (permalink / raw)
To: Tatsuya S; +Cc: Benjamin Tissoires, linux-input, linux-kernel
On Thu, 26 Sep 2024, Tatsuya S wrote:
> For main items, separate warning of reserved item tag from
> warning of unknown item tag.
Sorry for the delay, this patch fell in between cracks.
I think the change is fine, could you please just extend the changelog
with the reference to the relevant part of the specification, so that it's
properly documented?
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] HID: Add reserved item tag for main items
2024-11-06 13:51 ` Jiri Kosina
@ 2024-11-07 5:38 ` t s
0 siblings, 0 replies; 3+ messages in thread
From: t s @ 2024-11-07 5:38 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Benjamin Tissoires, linux-input, linux-kernel
On 2024/11/06 22:51, Jiri Kosina wrote:
> On Thu, 26 Sep 2024, Tatsuya S wrote:
>
>> For main items, separate warning of reserved item tag from
>> warning of unknown item tag.
> Sorry for the delay, this patch fell in between cracks.
No problem, thank you for your review.
>
> I think the change is fine, could you please just extend the changelog
> with the reference to the relevant part of the specification, so that it's
> properly documented?
OK.
>
> Thanks,
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-07 5:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-26 7:25 [PATCH] HID: Add reserved item tag for main items Tatsuya S
2024-11-06 13:51 ` Jiri Kosina
2024-11-07 5:38 ` t s
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®