diff options
author | Nikolai Kondrashov <spbnick@gmail.com> | 2010-08-22 13:26:22 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-09-02 03:36:11 -0400 |
commit | 67168fd7d4044f21c542128529216cfaad23c03e (patch) | |
tree | ce7fe277fca3fd2ef32fdf055431e680a668e1a9 /drivers/hid | |
parent | cdd49a85e237929a4c00965f1a88bdd9195898d8 (diff) |
HID: rdesc parser: remove local item size limit
The HID report descriptor parser requires local items, except "delimiters",
to have data. I.e. to have non-zero size. This removes the restriction.
The HID specification doesn't seem to have such restriction and, for
example, a "usage" item could have zero size if the usage ID is zero.
At least one usage page - Keyboard/Keypad lists zero ID as valid.
This doesn't seem to happen in the wild, probably because the official tool
for authoring report descriptors always puts data even for zero values for
some items, including "usage" items.
However, this makes little sense and at least one open source tool for
descriptor authoring generates zero data size "usage" items, which saves
some space, especially if many such items are used in a descriptor.
Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-core.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index d0240d5e7793..fbabe52cbcdc 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -388,12 +388,6 @@ static int hid_parser_local(struct hid_parser *parser, struct hid_item *item) | |||
388 | __u32 data; | 388 | __u32 data; |
389 | unsigned n; | 389 | unsigned n; |
390 | 390 | ||
391 | /* Local delimiter could have value 0, which allows size to be 0 */ | ||
392 | if (item->size == 0 && item->tag != HID_LOCAL_ITEM_TAG_DELIMITER) { | ||
393 | dbg_hid("item data expected for local item\n"); | ||
394 | return -1; | ||
395 | } | ||
396 | |||
397 | data = item_udata(item); | 391 | data = item_udata(item); |
398 | 392 | ||
399 | switch (item->tag) { | 393 | switch (item->tag) { |