Skip to content

Commit 9131d6a

Browse files
nir9Daniel Thompson
authored andcommitted
kdb: Remove fallback interpretation of arbitrary numbers as hex
Remove logic that enables a fallback of interpreting numbers supplied in KDB CLI to be interpreted as hex without explicit "0x" prefix as this can be confusing for the end users. Suggested-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Nir Lichtman <nir@lichtman.org> Link: https://lore.kernel.org/r/20241028192228.GC918454@lichtman.org Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
1 parent 0c10cc2 commit 9131d6a

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

kernel/debug/kdb/kdb_main.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -402,23 +402,15 @@ static void kdb_printenv(void)
402402
*/
403403
int kdbgetularg(const char *arg, unsigned long *value)
404404
{
405-
/*
406-
* If the first fails, also try base 16, for us
407-
* folks too lazy to type the leading 0x...
408-
*/
409-
if (kstrtoul(arg, 0, value)) {
410-
if (kstrtoul(arg, 16, value))
411-
return KDB_BADINT;
412-
}
405+
if (kstrtoul(arg, 0, value))
406+
return KDB_BADINT;
413407
return 0;
414408
}
415409

416410
int kdbgetu64arg(const char *arg, u64 *value)
417411
{
418-
if (kstrtou64(arg, 0, value)) {
419-
if (kstrtou64(arg, 16, value))
420-
return KDB_BADINT;
421-
}
412+
if (kstrtou64(arg, 0, value))
413+
return KDB_BADINT;
422414
return 0;
423415
}
424416

0 commit comments

Comments
 (0)