mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
global: Convert simple_strtoul() with decimal to dectoul()
It is a pain to have to specify the value 10 in each call. Add a new dectoul() function and update the code to use it. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
13
net/tftp.c
13
net/tftp.c
@@ -554,8 +554,7 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
|
||||
for (i = 0; i+8 < len; i++) {
|
||||
if (strcasecmp((char *)pkt + i, "blksize") == 0) {
|
||||
tftp_block_size = (unsigned short)
|
||||
simple_strtoul((char *)pkt + i + 8,
|
||||
NULL, 10);
|
||||
dectoul((char *)pkt + i + 8, NULL);
|
||||
debug("Blocksize oack: %s, %d\n",
|
||||
(char *)pkt + i + 8, tftp_block_size);
|
||||
if (tftp_block_size > tftp_block_size_option) {
|
||||
@@ -566,8 +565,7 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
|
||||
}
|
||||
if (strcasecmp((char *)pkt + i, "timeout") == 0) {
|
||||
timeout_val_rcvd = (unsigned short)
|
||||
simple_strtoul((char *)pkt + i + 8,
|
||||
NULL, 10);
|
||||
dectoul((char *)pkt + i + 8, NULL);
|
||||
debug("Timeout oack: %s, %d\n",
|
||||
(char *)pkt + i + 8, timeout_val_rcvd);
|
||||
if (timeout_val_rcvd != (timeout_ms / 1000)) {
|
||||
@@ -578,16 +576,15 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
|
||||
}
|
||||
#ifdef CONFIG_TFTP_TSIZE
|
||||
if (strcasecmp((char *)pkt + i, "tsize") == 0) {
|
||||
tftp_tsize = simple_strtoul((char *)pkt + i + 6,
|
||||
NULL, 10);
|
||||
tftp_tsize = dectoul((char *)pkt + i + 6,
|
||||
NULL);
|
||||
debug("size = %s, %d\n",
|
||||
(char *)pkt + i + 6, tftp_tsize);
|
||||
}
|
||||
#endif
|
||||
if (strcasecmp((char *)pkt + i, "windowsize") == 0) {
|
||||
tftp_windowsize =
|
||||
simple_strtoul((char *)pkt + i + 11,
|
||||
NULL, 10);
|
||||
dectoul((char *)pkt + i + 11, NULL);
|
||||
debug("windowsize = %s, %d\n",
|
||||
(char *)pkt + i + 11, tftp_windowsize);
|
||||
}
|
||||
|
Reference in New Issue
Block a user