Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5 -1
+5 -1
drivers/hid/hid-input.c
··· 1042 1042 1043 1043 /* 1044 1044 * 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. 1046 1050 */ 1047 1051 if ((field->flags & HID_MAIN_ITEM_VARIABLE) && 1048 1052 (field->logical_minimum < field->logical_maximum) &&