From patchwork Mon Jul 11 08:08:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Salveti X-Patchwork-Id: 2641 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7A76524059 for ; Mon, 11 Jul 2011 08:08:36 +0000 (UTC) Received: from mail-qy0-f173.google.com (mail-qy0-f173.google.com [209.85.216.173]) by fiordland.canonical.com (Postfix) with ESMTP id 427D9A18682 for ; Mon, 11 Jul 2011 08:08:36 +0000 (UTC) Received: by qyk10 with SMTP id 10so1494137qyk.11 for ; Mon, 11 Jul 2011 01:08:35 -0700 (PDT) Received: by 10.229.217.3 with SMTP id hk3mr1886816qcb.38.1310371715386; Mon, 11 Jul 2011 01:08:35 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.217.78 with SMTP id hl14cs200611qcb; Mon, 11 Jul 2011 01:08:34 -0700 (PDT) Received: by 10.90.172.1 with SMTP id u1mr3817592age.200.1310371714479; Mon, 11 Jul 2011 01:08:34 -0700 (PDT) Received: from mail-gy0-f178.google.com (mail-gy0-f178.google.com [209.85.160.178]) by mx.google.com with ESMTPS id h17si8212211and.107.2011.07.11.01.08.34 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 01:08:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.178 is neither permitted nor denied by best guess record for domain of ricardo.salveti@linaro.org) client-ip=209.85.160.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.178 is neither permitted nor denied by best guess record for domain of ricardo.salveti@linaro.org) smtp.mail=ricardo.salveti@linaro.org Received: by gyf1 with SMTP id 1so1684278gyf.37 for ; Mon, 11 Jul 2011 01:08:33 -0700 (PDT) Received: by 10.236.116.6 with SMTP id f6mr3596496yhh.106.1310371713654; Mon, 11 Jul 2011 01:08:33 -0700 (PDT) Received: from localhost.localdomain ([201.82.65.93]) by mx.google.com with ESMTPS id f4sm5910850yhn.13.2011.07.11.01.08.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 01:08:33 -0700 (PDT) From: Ricardo Salveti de Araujo To: x-loader@googlegroups.com Cc: patches@linaro.org, Ricardo Salveti de Araujo Subject: [PATCH] lib/printf.c: making serial_printf return vsprintf ret value Date: Mon, 11 Jul 2011 05:08:22 -0300 Message-Id: <1310371702-28848-1-git-send-email-ricardo.salveti@linaro.org> X-Mailer: git-send-email 1.7.4.1 Making it work the same way as current u-boot head, and as a side effect also fixing build when -Werror=unused-but-set-variable is used: printf.c: In function 'serial_printf': printf.c:290:7: error: variable 'i' set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors Signed-off-by: Ricardo Salveti de Araujo --- include/common.h | 2 +- lib/printf.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/common.h b/include/common.h index ffaf582..a3c5092 100644 --- a/include/common.h +++ b/include/common.h @@ -98,7 +98,7 @@ int serial_getc (void); int serial_tstc (void); /* lib/printf.c */ -void serial_printf (const char *fmt, ...); +int serial_printf (const char *fmt, ...); #endif /* lib/crc.c */ diff --git a/lib/printf.c b/lib/printf.c index 91d22fc..b1dfe0b 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -284,7 +284,7 @@ static int vsprintf(char *buf, const char *fmt, va_list args) return str-buf; } -void serial_printf (const char *fmt, ...) +int serial_printf (const char *fmt, ...) { va_list args; uint i; @@ -300,5 +300,6 @@ void serial_printf (const char *fmt, ...) /* Print the string */ serial_puts (printbuffer); + return i; } #endif