From 8a2f16b6eb5b4e56f7fb6b429ea6aef4d8719bc1 Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Mon, 14 May 2012 15:02:56 +0200 Subject: [PATCH] HID: explain the signed/unsigned handling in hid_add_field() Put a comment that clarifies the condition that handles both signed and unsigned case for logical min/max in hid_add_field(). Change-Id: I3c701f063aace2b08dadd1bcd668dd65036e9d07 Signed-off-by: Jiri Kosina Signed-off-by: Kevin F. Haggerty --- drivers/hid/hid-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 335420f2045..1a794c3aecd 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -232,6 +232,7 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign return -1; } + /* Handle both signed and unsigned cases properly */ if ((parser->global.logical_minimum < 0 && parser->global.logical_maximum < parser->global.logical_minimum) ||