cmd: Use strtoul instead of _strtoul
The non-underscore one comes from vsprintf. Signed-off-by: Sean Cross <xobs@kosagi.com>
This commit is contained in:
parent
698b123bd0
commit
f8991202c6
8 changed files with 16 additions and 16 deletions
2
cmd-bl.c
2
cmd-bl.c
|
@ -15,7 +15,7 @@ int cmd_bl(int argc, char **argv)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
level = _strtoul(argv[0], NULL, 0);
|
level = strtoul(argv[0], NULL, 0);
|
||||||
|
|
||||||
if( level > BLLED_MAX_LEVEL ) {
|
if( level > BLLED_MAX_LEVEL ) {
|
||||||
level = 0;
|
level = 0;
|
||||||
|
|
|
@ -14,10 +14,10 @@ int cmd_hex(int argc, char **argv)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = _strtoul(argv[0], NULL, 0);
|
offset = strtoul(argv[0], NULL, 0);
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
count = _strtoul(argv[1], NULL, 0);
|
count = strtoul(argv[1], NULL, 0);
|
||||||
|
|
||||||
serial_print_hex((const void *)offset, count);
|
serial_print_hex((const void *)offset, count);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -21,7 +21,7 @@ int cmd_irq(int argc, char **argv)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
num = _strtoul(argv[1], NULL, 0);
|
num = strtoul(argv[1], NULL, 0);
|
||||||
if (num >= __irq_max__) {
|
if (num >= __irq_max__) {
|
||||||
printf("Only %d IRQs present\n", __irq_max__);
|
printf("Only %d IRQs present\n", __irq_max__);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -14,7 +14,7 @@ int cmd_led(int argc, char **argv)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
state = _strtoul(argv[0], NULL, 0);
|
state = strtoul(argv[0], NULL, 0);
|
||||||
|
|
||||||
if( state ) {
|
if( state ) {
|
||||||
*((volatile uint32_t *) BIG_LED_ADDR) = BIG_LED_ON;
|
*((volatile uint32_t *) BIG_LED_ADDR) = BIG_LED_ON;
|
||||||
|
|
|
@ -16,8 +16,8 @@ int cmd_load(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = _strtoul(argv[0], NULL, 0);
|
offset = strtoul(argv[0], NULL, 0);
|
||||||
total = _strtoul(argv[1], NULL, 0);
|
total = strtoul(argv[1], NULL, 0);
|
||||||
|
|
||||||
left = total;
|
left = total;
|
||||||
while (left--)
|
while (left--)
|
||||||
|
@ -41,8 +41,8 @@ int cmd_loadjump(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = _strtoul(argv[0], NULL, 0);
|
offset = strtoul(argv[0], NULL, 0);
|
||||||
total = _strtoul(argv[1], NULL, 0);
|
total = strtoul(argv[1], NULL, 0);
|
||||||
jumpaddr = (void (*)(void))offset;
|
jumpaddr = (void (*)(void))offset;
|
||||||
|
|
||||||
left = total;
|
left = total;
|
||||||
|
|
|
@ -13,7 +13,7 @@ int cmd_peek(int argc, char **argv)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = _strtoul(argv[0], NULL, 0);
|
offset = strtoul(argv[0], NULL, 0);
|
||||||
|
|
||||||
printf("Value at 0x%08x: ", offset);
|
printf("Value at 0x%08x: ", offset);
|
||||||
printf("0x%08x\n", *((volatile uint32_t *)offset));
|
printf("0x%08x\n", *((volatile uint32_t *)offset));
|
||||||
|
@ -30,8 +30,8 @@ int cmd_poke(int argc, char **argv)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = _strtoul(argv[0], NULL, 0);
|
offset = strtoul(argv[0], NULL, 0);
|
||||||
val = _strtoul(argv[1], NULL, 0);
|
val = strtoul(argv[1], NULL, 0);
|
||||||
|
|
||||||
printf("Setting value at 0x%08x to 0x%08x: ", offset, val);
|
printf("Setting value at 0x%08x to 0x%08x: ", offset, val);
|
||||||
writel(val, offset);
|
writel(val, offset);
|
||||||
|
|
|
@ -11,7 +11,7 @@ int cmd_msleep(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
msecs = _strtoul(argv[0], NULL, 0);
|
msecs = strtoul(argv[0], NULL, 0);
|
||||||
_msleep(msecs);
|
_msleep(msecs);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ int cmd_usleep(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
usecs = _strtoul(argv[0], NULL, 0);
|
usecs = strtoul(argv[0], NULL, 0);
|
||||||
_usleep(usecs);
|
_usleep(usecs);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,11 +31,11 @@ int cmd_spi(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
recv_bytes_count = _strtoul(argv[0], NULL, 0);
|
recv_bytes_count = strtoul(argv[0], NULL, 0);
|
||||||
uint8_t recv_bytes[recv_bytes_count];
|
uint8_t recv_bytes[recv_bytes_count];
|
||||||
|
|
||||||
for (i = 1; i < argc; i++)
|
for (i = 1; i < argc; i++)
|
||||||
xmit_bytes[i - 1] = _strtoul(argv[i], NULL, 0);
|
xmit_bytes[i - 1] = strtoul(argv[i], NULL, 0);
|
||||||
|
|
||||||
printf("Transmitting %d bytes and expecting a response with %d bytes:\n",
|
printf("Transmitting %d bytes and expecting a response with %d bytes:\n",
|
||||||
sizeof(xmit_bytes), sizeof(recv_bytes));
|
sizeof(xmit_bytes), sizeof(recv_bytes));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue