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 <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Nir Lichtman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Thompson <[email protected]>
1 parent 0c10cc2 commit 9131d6a

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

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)