[PATCH v4 01/16] mtrr: Don't show an invalid CPU number

Simon Glass sjg at chromium.org
Fri May 5 00:54:54 CEST 2023

When U-Boot did not do the MP init, we don't get an actual CPU number
here. Skip printing it in that case.

Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>

(no changes since v2)

Changes in v2:
- Don't show an invalid CPU number on error

 cmd/x86/mtrr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c
index b213a942fde..b1691d8b65a 100644
--- a/cmd/x86/mtrr.c
+++ b/cmd/x86/mtrr.c
@@ -148,7 +148,8 @@ static int do_mtrr(struct cmd_tbl *cmdtp, int flag, int argc,
 			printf("CPU %d:\n", i);
 			ret = do_mtrr_list(reg_count, i);
 			if (ret) {
-				printf("Failed to read CPU %d (err=%d)\n", i,
+				printf("Failed to read CPU %s (err=%d)\n",
+				       i < MP_SELECT_ALL ? simple_itoa(i) : "",
 				return CMD_RET_FAILURE;

More information about the U-Boot mailing list