]> git.baikalelectronics.ru Git - uboot.git/commit
x86: mtrr: Fix parsing of "mtrr list" command
authorWolfgang Wallner <wolfgang.wallner@br-automation.com>
Fri, 14 Aug 2020 07:55:24 +0000 (09:55 +0200)
committerBin Meng <bmeng.cn@gmail.com>
Tue, 1 Sep 2020 05:24:45 +0000 (13:24 +0800)
commit78b40b40655ad755b90e4c21030d909d47c288ef
treef91d497db2ee0998a3dbbeb31b996ac1d03cb9ed
parent10b8a43f6b0b497bea4b8f6bb7b5ac2f8a6a5366
x86: mtrr: Fix parsing of "mtrr list" command

The command 'mtrr' does not recognize the 'list' subcommand any more
since the code restructuring in commit b5ecb84a4769 ("x86: mtrr:
Restructure so command execution is in one place").

The if-else parsing the command arguments does not take 'list' into
account: the if-branch is intended for no subcommands, the else-branch
is intended for the non-list subcommands (which all expect additional
arguments). Calling the 'mtrr list' subcommand leads to a "return
CMD_RET_USAGE" in the else-branch.

Fix this by changing the else-branch to explicitly checking for
if (cmd != 'l').

Fixes: b5ecb84a4769 ("x86: mtrr: Restructure so command execution is in one place")
Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
cmd/x86/mtrr.c