lmb.c: add missing comma in lmb_dump_region()

In the message string " %s[%d]\t[0x%llx-0x%llx], 0x%08llx bytes flags: "
a comma is missing before flags.

To avoid increasing the code size replace '0x%' by '%#'.

Printing the size with leading zeros but not the addresses does not really
make sense. Remove the leading zeros from the size output.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
[trini: Fix test/cmd/bdinfo.c for these changes]
Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Heinrich Schuchardt 2024-11-07 11:14:42 +01:00 committed by Tom Rini
parent 5430a5f67e
commit dfe7ab3514
2 changed files with 4 additions and 4 deletions

View File

@ -506,7 +506,7 @@ static void lmb_dump_region(struct alist *lmb_rgn_lst, char *name)
enum lmb_flags flags;
int i;
printf(" %s.count = 0x%x\n", name, lmb_rgn_lst->count);
printf(" %s.count = %#x\n", name, lmb_rgn_lst->count);
for (i = 0; i < lmb_rgn_lst->count; i++) {
base = rgn[i].base;
@ -514,7 +514,7 @@ static void lmb_dump_region(struct alist *lmb_rgn_lst, char *name)
end = base + size - 1;
flags = rgn[i].flags;
printf(" %s[%d]\t[0x%llx-0x%llx], 0x%08llx bytes flags: ",
printf(" %s[%d]\t[%#llx-%#llx], %#llx bytes, flags: ",
name, i, base, end, size);
lmb_print_region_flags(flags);
}

View File

@ -107,7 +107,7 @@ static int lmb_test_dump_region(struct unit_test_state *uts,
enum lmb_flags flags;
int i;
ut_assert_nextline(" %s.count = 0x%hx", name, lmb_rgn_lst->count);
ut_assert_nextline(" %s.count = %#x", name, lmb_rgn_lst->count);
for (i = 0; i < lmb_rgn_lst->count; i++) {
base = rgn[i].base;
@ -119,7 +119,7 @@ static int lmb_test_dump_region(struct unit_test_state *uts,
ut_assert_nextlinen(" %s[%d]\t[", name, i);
continue;
}
ut_assert_nextlinen(" %s[%d]\t[0x%llx-0x%llx], 0x%08llx bytes flags: ",
ut_assert_nextlinen(" %s[%d]\t[%#llx-%#llx], %#llx bytes, flags: ",
name, i, base, end, size);
}