aboutsummaryrefslogtreecommitdiff
path: root/cmd/eeprom.c
diff options
context:
space:
mode:
authorBaruch Siach2022-10-23 12:28:12 +0300
committerTom Rini2022-11-02 13:58:17 -0400
commitaa59c1bec793c1e8155032268ac95171437aa418 (patch)
tree879a6eaa376e14ce4956c7f3a1f7525358e36720 /cmd/eeprom.c
parent0b999d208230e52d5bc1e082a2491eb25bd59e32 (diff)
cmd: eeprom: don't truncate target address at 32-bit
On 64-bit platforms where int is 32-bit wide, the eeprom command parse_numeric_param() routine truncates the memory address parameter to the lower 32-bit. Make parse_numeric_param() return long to allow read/write of addresses beyond the lower 4GB. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'cmd/eeprom.c')
-rw-r--r--cmd/eeprom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/eeprom.c b/cmd/eeprom.c
index fc0d4440694..0b6ca8c505f 100644
--- a/cmd/eeprom.c
+++ b/cmd/eeprom.c
@@ -200,10 +200,10 @@ int eeprom_write(unsigned dev_addr, unsigned offset,
return ret;
}
-static int parse_numeric_param(char *str)
+static long parse_numeric_param(char *str)
{
char *endptr;
- int value = simple_strtol(str, &endptr, 16);
+ long value = simple_strtol(str, &endptr, 16);
return (*endptr != '\0') ? -1 : value;
}