]> git.baikalelectronics.ru Git - kernel.git/commit
kdb: Get rid of confusing diag msg from "rd" if current task has no regs
authorDouglas Anderson <dianders@chromium.org>
Sat, 9 Nov 2019 19:16:44 +0000 (11:16 -0800)
committerDaniel Thompson <daniel.thompson@linaro.org>
Fri, 31 Jan 2020 17:34:03 +0000 (17:34 +0000)
commitcc67b6f6ebb007000a6f7f6c65aed1d3284c720e
tree7a5a1d1bfa085a2ac07ede27a2af6c7c0c0189fc
parent97b78e8d63ebb740c6976ac5cd16507c1a1c4b39
kdb: Get rid of confusing diag msg from "rd" if current task has no regs

If you switch to a sleeping task with the "pid" command and then type
"rd", kdb tells you this:

  No current kdb registers.  You may need to select another task
  diag: -17: Invalid register name

The first message makes sense, but not the second.  Fix it by just
returning 0 after commands accessing the current registers finish if
we've already printed the "No current kdb registers" error.

While fixing kdb_rd(), change the function to use "if" rather than
"ifdef".  It cleans the function up a bit and any modern compiler will
have no trouble handling still producing good code.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20191109111624.5.I121f4c6f0c19266200bf6ef003de78841e5bfc3d@changeid
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
kernel/debug/kdb/kdb_main.c