Skip to contentSkip to conversation

Drivers: HID: fix warnings: from is u16 which never < 0

PATCH Applied Chen Gang 2 participants 3 messages Apr 7, 2013 – Apr 25, 2013 HID

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 Drivers: HID: fix warnings: from is u16 which never < 0

from is u16 which never < 0.

---
 drivers/hid/hid-icade.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hid/hid-icade.c +1 -1
index 09dcc04..76b5a75 100644
@@ -159,7 +159,7 @@ static const struct icade_key icade_usage_table[30] = {
 
 static const struct icade_key *icade_find_translation(u16 from)
 {
-	if (from < 0 || from > ICADE_MAX_USAGE)
+	if (from > ICADE_MAX_USAGE)
 		return NULL;
 	return &icade_usage_table[from];
 }
Signature · 1 line
1.7.7.6
Applied
#1 lore raw
Quoted 13 lines · Chen Gang

from is u16 which never < 0.

---
 drivers/hid/hid-icade.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hid/hid-icade.c +0 -0
index 09dcc04..76b5a75 100644

drivers/hid/hid-icade.c static const struct icade_key icade_usage_table[30] = { · line 165

Quoted 8 lines
drivers/hid/hid-icade.c +1 -1
@@ -159,7 +159,7 @@ static const struct icade_key icade_usage_table[30] = {
 
 static const struct icade_key *icade_find_translation(u16 from)
 {
-	if (from < 0 || from > ICADE_MAX_USAGE)
+	if (from > ICADE_MAX_USAGE)
 		return NULL;
 	return &icade_usage_table[from];
 }

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs
author
#2 lore raw
Quoted 16 lines · Jiri Kosina
Quoted 14 lines · Chen Gang
Quoted 14 lines

from is u16 which never < 0.

---
 drivers/hid/hid-icade.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hid/hid-icade.c +0 -0
index 09dcc04..76b5a75 100644
@@ -159,7 +159,7 @@ static const struct icade_key icade_usage_table[30] = {
 
Quoted 8 lines
Quoted 7 lines

drivers/hid/hid-icade.c static const struct icade_key icade_usage_table[30] = { · line 165

Quoted 7 lines
drivers/hid/hid-icade.c +1 -1
 static const struct icade_key *icade_find_translation(u16 from)
 {
-	if (from < 0 || from > ICADE_MAX_USAGE)
+	if (from > ICADE_MAX_USAGE)
 		return NULL;
 	return &icade_usage_table[from];
 }

Applied, thanks.

Thanks, too.

Signature · 7 lines
Chen Gang

Asianux Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html