git.openpandora.org
/
pandora-u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96dfa58
)
common: eeprom_field: Drop unnecessary comparison
author
Marek Behún
<kabel@kernel.org>
Tue, 21 May 2024 07:13:28 +0000
(09:13 +0200)
committer
Tom Rini
<trini@konsulko.com>
Fri, 7 Jun 2024 16:47:59 +0000
(10:47 -0600)
The byte variable is of type unsigned char, it is never less than zero.
The error case is handled by *endptr, so drop the comparison altogether.
Signed-off-by: Marek Behún <kabel@kernel.org>
common/eeprom/eeprom_field.c
patch
|
blob
|
history
diff --git
a/common/eeprom/eeprom_field.c
b/common/eeprom/eeprom_field.c
index
9b83141
..
26f6041
100644
(file)
--- a/
common/eeprom/eeprom_field.c
+++ b/
common/eeprom/eeprom_field.c
@@
-56,7
+56,7
@@
static int __eeprom_field_update_bin(struct eeprom_field *field,
}
byte = simple_strtoul(tmp, &endptr, 16);
- if (*endptr != '\0'
|| byte < 0
)
+ if (*endptr != '\0')
return -1;
field->buf[j] = byte;