]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtrr: Don't show an invalid CPU number
authorSimon Glass <sjg@chromium.org>
Thu, 4 May 2023 22:54:54 +0000 (16:54 -0600)
committerBin Meng <bmeng@tinylab.org>
Thu, 11 May 2023 02:25:29 +0000 (10:25 +0800)
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@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
cmd/x86/mtrr.c

index b213a942fde40062c6b8cc58ed4372de80c03f9a..b1691d8b65abdea8177f0b54c17260d83ecf4b38 100644 (file)
@@ -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) : "",
                                       ret);
                                return CMD_RET_FAILURE;
                        }