From 7e5f460ec457fe310156e399198a41eb0ce1e98c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 24 Jul 2021 09:03:29 -0600 Subject: global: Convert simple_strtoul() with hex to hextoul() It is a pain to have to specify the value 16 in each call. Add a new hextoul() function and update the code to use it. Add a proper comment to simple_strtoul() while we are here. Signed-off-by: Simon Glass --- board/ti/am64x/evm.c | 2 +- board/ti/j721e/evm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'board/ti') diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c index cdbb9a8..21c58c7 100644 --- a/board/ti/am64x/evm.c +++ b/board/ti/am64x/evm.c @@ -120,7 +120,7 @@ static void setup_serial(void) if (env_get("serial#")) return; - board_serial = simple_strtoul(ep->serial, &endp, 16); + board_serial = hextoul(ep->serial, &endp); if (*endp != '\0') { pr_err("Error: Can't set serial# to %s\n", ep->serial); return; diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index 580f13c..077d834 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -201,7 +201,7 @@ static void setup_serial(void) if (env_get("serial#")) return; - board_serial = simple_strtoul(ep->serial, &endp, 16); + board_serial = hextoul(ep->serial, &endp); if (*endp != '\0') { pr_err("Error: Can't set serial# to %s\n", ep->serial); return; -- cgit v1.1