From 7addcb33ef7b27cbc6f5802194c48d1f5736011d Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Wed, 15 Aug 2018 16:54:55 +0100 Subject: libc: Remove printf-like functions They are too big for the Trusted Firmware, and it can be confusing to have two versions of the same functions with different names. tf_printf and tf_snprintf will replace them in the next patch. Change-Id: I978414ac169cc3156e249549ef101a70eb31a295 Signed-off-by: Antonio Nino Diaz --- lib/libc/printf.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 lib/libc/printf.c (limited to 'lib/libc/printf.c') diff --git a/lib/libc/printf.c b/lib/libc/printf.c deleted file mode 100644 index f6156414..00000000 --- a/lib/libc/printf.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include -#include - -/* Choose max of 128 chars for now. */ -#define PRINT_BUFFER_SIZE 128 -int printf(const char *fmt, ...) -{ - va_list args; - char buf[PRINT_BUFFER_SIZE]; - int count; - - va_start(args, fmt); - vsnprintf(buf, sizeof(buf) - 1, fmt, args); - va_end(args); - - /* Use putchar directly as 'puts()' adds a newline. */ - buf[PRINT_BUFFER_SIZE - 1] = '\0'; - count = 0; - while (buf[count]) - { - if (putchar(buf[count]) != EOF) { - count++; - } else { - count = EOF; - break; - } - } - - return count; -} -- cgit v1.2.3