display_options: Support printing a 32-bit value

On 64-bit machines we don't always want to show 16 hex digits,
particularly if the value is 32-bit. Add a new function to show a 32-bit
value.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-07-05 10:30:51 -06:00
parent 0f640f96c8
commit 8ed299f3be
2 changed files with 6 additions and 0 deletions

View File

@@ -104,6 +104,7 @@ char *display_options_get_banner_priv(bool newlines, const char *build_tag,
/* Print a numeric value (for use in arch_print_bdinfo()) */
void lprint_num_l(const char *name, ulong value);
void lprint_num_ll(const char *name, unsigned long long value);
void lprint_num_32(const char *name, u32 value);
/* Print a string value (for use in arch_print_bdinfo()) */
void lprint_str(const char *name, const char *str);

View File

@@ -263,3 +263,8 @@ void lprint_num_ll(const char *name, unsigned long long value)
{
printf("%-12s= 0x%.*llx\n", name, 2 * (int)sizeof(ulong), value);
}
void lprint_num_32(const char *name, u32 value)
{
printf("%-12s= 0x%08x\n", name, value);
}