vsprintf: Support phys_addr_t specifier unconditionally
authorThierry Reding <treding@nvidia.com>
Tue, 12 Mar 2019 10:38:00 +0000 (11:38 +0100)
committerSimon Glass <sjg@chromium.org>
Fri, 12 Apr 2019 02:10:05 +0000 (20:10 -0600)
When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
lib/vsprintf.c

index 1b6c154d8d722215767a7cef1c850850dda6088a..2403825dc98d9c0430eb5b76e8d0bbc83ae09440 100644 (file)
@@ -457,7 +457,6 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
                return device_path_string(buf, end, ptr, field_width,
                                          precision, flags);
 #endif
-#ifdef CONFIG_CMD_NET
        case 'a':
                flags |= SPECIAL | ZEROPAD;
 
@@ -469,6 +468,7 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
                        break;
                }
                break;
+#ifdef CONFIG_CMD_NET
        case 'm':
                flags |= SPECIAL;
                /* Fallthrough */