[PATCH] x86: mtrr: Fix parsing of "mtrr list" command

Simon Glass sjg at chromium.org
Sun Aug 16 05:39:48 CEST 2020


On Fri, 14 Aug 2020 at 01:55, Wolfgang Wallner
<wolfgang.wallner at br-automation.com> wrote:
>
> The command 'mtrr' does not recognize the 'list' subcommand any more
> since the code restructuring in commit b2a76b3fe75a ("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: b2a76b3fe75a ("x86: mtrr: Restructure so command execution is in one place")
>
> Signed-off-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
>
> ---
>
>  cmd/x86/mtrr.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg at chromium.org>

Ah yes, I never actually use it - since it is implicit.

Regards,
Simon


More information about the U-Boot mailing list