summaryrefslogtreecommitdiff
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-08-31 21:31:25 +0200
committerAlexander Graf <agraf@suse.de>2018-09-23 21:55:29 +0200
commitfbb3ea806f62b7e27bbae86c42d8f73f05de4bd7 (patch)
tree5b5fd3bc48f9c6f3bdaa7b03c6276327330bcb89 /lib/vsprintf.c
parent7a9e6ee6eb83b1dd91032d246702555d7b5a8452 (diff)
downloadu-boot-fbb3ea806f62b7e27bbae86c42d8f73f05de4bd7.tar.gz
lib: build charset.o only if needed
charset.o is only needed for the EFI subsystem Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index ef8b0b5989..632796f864 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -274,6 +274,8 @@ static char *string(char *buf, char *end, char *s, int field_width,
return buf;
}
+/* U-Boot uses UTF-16 strings in the EFI context only. */
+#if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(API_BUILD)
static char *string16(char *buf, char *end, u16 *s, int field_width,
int precision, int flags)
{
@@ -294,8 +296,6 @@ static char *string16(char *buf, char *end, u16 *s, int field_width,
return buf;
}
-/* Device paths only exist in the EFI context. */
-#if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(API_BUILD)
static char *device_path_string(char *buf, char *end, void *dp, int field_width,
int precision, int flags)
{
@@ -612,10 +612,14 @@ repeat:
continue;
case 's':
- if (qualifier == 'l' && !IS_ENABLED(CONFIG_SPL_BUILD)) {
+/* U-Boot uses UTF-16 strings in the EFI context only. */
+#if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(API_BUILD)
+ if (qualifier == 'l') {
str = string16(str, end, va_arg(args, u16 *),
field_width, precision, flags);
- } else {
+ } else
+#endif
+ {
str = string(str, end, va_arg(args, char *),
field_width, precision, flags);
}