mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-14 00:47:26 +00:00
x86: mtrr: Fix parsing of "mtrr list" command
The command 'mtrr' does not recognize the 'list' subcommand any more since the code restructuring in commitb2a76b3fe7
("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:b2a76b3fe7
("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>
This commit is contained in:
parent
23e333a5c0
commit
cf9f38064d
1 changed files with 2 additions and 1 deletions
|
@ -121,7 +121,8 @@ static int do_mtrr(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
if (argc < 1 || !cmd) {
|
if (argc < 1 || !cmd) {
|
||||||
cmd = 'l';
|
cmd = 'l';
|
||||||
reg = 0;
|
reg = 0;
|
||||||
} else {
|
}
|
||||||
|
if (cmd != 'l') {
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
reg = simple_strtoul(argv[1], NULL, 16);
|
reg = simple_strtoul(argv[1], NULL, 16);
|
||||||
|
|
Loading…
Reference in a new issue