x86: cmd: hob: Fix display of resource type for system memory
authorBin Meng <bmeng.cn@gmail.com>
Sat, 31 Jul 2021 08:45:28 +0000 (16:45 +0800)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 2 Aug 2021 07:11:41 +0000 (15:11 +0800)
The resource type for system memory is currently displayed as
"unknown", which is wrong.

Fixes: 51af144eb7a0 ("x86: Allow showing details about a HOB entry")
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested on chromebook_coral, chromebook_samus, chromebook_link, minnowmax
Tested-by: Simon Glass <sjg@chromium.org>
cmd/x86/hob.c

index 71e7fcb..04d092d 100644 (file)
@@ -78,7 +78,7 @@ static void show_hob_details(const struct hob_header *hdr)
                const struct hob_res_desc *res = ptr;
                const char *typename;
 
-               typename = res->type > 0 && res->type <= RES_MAX_MEM_TYPE ?
+               typename = res->type >= RES_SYS_MEM && res->type <= RES_MAX_MEM_TYPE ?
                        res_type[res->type] : "unknown";
 
                printf("     base = %08llx, len = %08llx, end = %08llx, type = %d (%s)\n\n",