diff options
author | Nir Lichtman <nir@lichtman.org> | 2024-10-28 20:22:28 +0100 |
---|---|---|
committer | Daniel Thompson <daniel.thompson@linaro.org> | 2024-11-02 09:33:13 +0100 |
commit | 9131d6a7a726d7a372bc35d27df9ebe3f011508e (patch) | |
tree | 4f141fa13f5a9393ff3bfa06a02b88a435ba7182 | |
parent | trace: kdb: Replace simple_strtoul with kstrtoul in kdb_ftdump (diff) | |
download | linux-9131d6a7a726d7a372bc35d27df9ebe3f011508e.tar.xz linux-9131d6a7a726d7a372bc35d27df9ebe3f011508e.zip |
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>
-rw-r--r-- | kernel/debug/kdb/kdb_main.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index f8703ab760d9..5f4be507d79f 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -402,23 +402,15 @@ static void kdb_printenv(void) */ int kdbgetularg(const char *arg, unsigned long *value) { - /* - * If the first fails, also try base 16, for us - * folks too lazy to type the leading 0x... - */ - if (kstrtoul(arg, 0, value)) { - if (kstrtoul(arg, 16, value)) - return KDB_BADINT; - } + if (kstrtoul(arg, 0, value)) + return KDB_BADINT; return 0; } int kdbgetu64arg(const char *arg, u64 *value) { - if (kstrtou64(arg, 0, value)) { - if (kstrtou64(arg, 16, value)) - return KDB_BADINT; - } + if (kstrtou64(arg, 0, value)) + return KDB_BADINT; return 0; } |