Skip to content

Commit a688393

Browse files
author
Jiri Kosina
committed
HID: explain out-of-range check better
Extend the comment explaining the condition for discarding out-of-range values to clarify the cases in which devices don't provide any logical min/max. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 6f1891d commit a688393

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎drivers/hid/hid-input.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,11 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
10421042

10431043
/*
10441044
* Ignore out-of-range values as per HID specification,
1045-
* section 5.10 and 6.2.25
1045+
* section 5.10 and 6.2.25.
1046+
*
1047+
* The logical_minimum < logical_maximum check is done so that we
1048+
* don't unintentionally discard values sent by devices which
1049+
* don't specify logical min and max.
10461050
*/
10471051
if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
10481052
(field->logical_minimum < field->logical_maximum) &&

0 commit comments

Comments
 (0)