diff options
author | Jiri Kosina <jkosina@suse.cz> | 2013-06-19 17:52:11 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-06-19 17:54:10 -0400 |
commit | a688393bd3fb27690a77f7ae8607b4969039bac5 (patch) | |
tree | fa7eee196868401562ce1be8d00c07904752ad1a /drivers/hid/hid-input.c | |
parent | 6f1891d01956cad406d2af8ed2e9cef6108bfc5e (diff) |
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>
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r-- | drivers/hid/hid-input.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 82130cf724e4..9aeca6023617 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -1042,7 +1042,11 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct | |||
1042 | 1042 | ||
1043 | /* | 1043 | /* |
1044 | * Ignore out-of-range values as per HID specification, | 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 | if ((field->flags & HID_MAIN_ITEM_VARIABLE) && | 1051 | if ((field->flags & HID_MAIN_ITEM_VARIABLE) && |
1048 | (field->logical_minimum < field->logical_maximum) && | 1052 | (field->logical_minimum < field->logical_maximum) && |