aboutsummaryrefslogtreecommitdiff
path: root/lib/tiny-printf.c
diff options
context:
space:
mode:
authorAlex Kiernan2018-04-19 04:32:55 +0000
committerTom Rini2018-04-28 18:32:23 -0400
commit4f1eed7527e256edd10fab85d2651a35e530509f (patch)
treed7f43a4ed86674908bf5794e8c9d0a4db133089d /lib/tiny-printf.c
parent14ad44ab466a8f4630c603f4c0bb5c57d0f27ae6 (diff)
spl: Disable printf if not required
Now we have a guard for printf, disable it in the build if it's not selected. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Diffstat (limited to 'lib/tiny-printf.c')
-rw-r--r--lib/tiny-printf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c
index 0b04813dc20..e29377e0004 100644
--- a/lib/tiny-printf.c
+++ b/lib/tiny-printf.c
@@ -23,11 +23,6 @@ struct printf_info {
void (*putc)(struct printf_info *info, char ch);
};
-static void putc_normal(struct printf_info *info, char ch)
-{
- putc(ch);
-}
-
static void out(struct printf_info *info, char c)
{
*info->bf++ = c;
@@ -321,6 +316,12 @@ abort:
return 0;
}
+#if CONFIG_IS_ENABLED(PRINTF)
+static void putc_normal(struct printf_info *info, char ch)
+{
+ putc(ch);
+}
+
int vprintf(const char *fmt, va_list va)
{
struct printf_info info;
@@ -343,6 +344,7 @@ int printf(const char *fmt, ...)
return ret;
}
+#endif
static void putc_outstr(struct printf_info *info, char ch)
{