]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kdb: Remove fallback interpretation of arbitrary numbers as hex
authorNir Lichtman <nir@lichtman.org>
Mon, 28 Oct 2024 19:22:28 +0000 (19:22 +0000)
committerDaniel Thompson <daniel.thompson@linaro.org>
Sat, 2 Nov 2024 08:33:13 +0000 (08:33 +0000)
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>
kernel/debug/kdb/kdb_main.c

index f8703ab760d9e36728ad7bd803e5e27d1169d98d..5f4be507d79fc3772a8f728688402dc70f07d4ef 100644 (file)
@@ -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;
 }