linux/kernel/debug/kdb
Douglas Anderson 1b310030bb kdb: Cleanup math with KDB_CMD_HISTORY_COUNT
From code inspection the math in handle_ctrl_cmd() looks super sketchy
because it subjects -1 from cmdptr and then does a "%
KDB_CMD_HISTORY_COUNT".  It turns out that this code works because
"cmdptr" is unsigned and KDB_CMD_HISTORY_COUNT is a nice power of 2.
Let's make this a little less sketchy.

This patch should be a no-op.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20200507161125.1.I2cce9ac66e141230c3644b8174b6c15d4e769232@changeid
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2020-06-02 15:15:46 +01:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
kdb_bp.c kdb: remove redundant assignment to pointer bp 2020-01-31 17:34:06 +00:00
kdb_bt.c kdb: Gid rid of implicit setting of the current task / regs 2020-01-31 17:34:00 +00:00
kdb_cmds kdb: cleanup unused variables missed in the original kdb merge 2011-08-01 13:23:58 -05:00
kdb_debugger.c kdb: Don't back trace on a cpu that didn't round up 2018-12-30 08:31:23 +00:00
kdb_io.c kdb: Use for_each_console() helper 2020-01-31 17:34:54 +00:00
kdb_keyboard.c kdb: kdb_keyboard: mark expected switch fall-throughs 2018-11-13 20:38:50 +00:00
kdb_main.c kdb: Cleanup math with KDB_CMD_HISTORY_COUNT 2020-06-02 15:15:46 +01:00
kdb_private.h kdb: Gid rid of implicit setting of the current task / regs 2020-01-31 17:34:00 +00:00
kdb_support.c kdb: kdb_support: replace strcpy() by strscpy() 2019-05-02 13:42:01 +01:00
Makefile kdb: Get rid of broken attempt to print CCVERSION in kdb summary 2019-05-12 09:50:43 +01:00