From patchwork Thu Oct 13 22:06:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: loic.minier@linaro.org X-Patchwork-Id: 4674 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 A03CE23DEE for ; Fri, 14 Oct 2011 09:58:54 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 964EBA18781 for ; Fri, 14 Oct 2011 09:58:54 +0000 (UTC) Received: by eyg5 with SMTP id 5so1327263eyg.11 for ; Fri, 14 Oct 2011 02:58:54 -0700 (PDT) Received: by 10.223.17.11 with SMTP id q11mr3118043faa.13.1318586334381; Fri, 14 Oct 2011 02:58:54 -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.152.24.41 with SMTP id r9cs8246laf; Fri, 14 Oct 2011 02:58:54 -0700 (PDT) Received: by 10.216.174.20 with SMTP id w20mr2983865wel.33.1318586333465; Fri, 14 Oct 2011 02:58:53 -0700 (PDT) Received: from pig2.dooz.org (pig2.dooz.org. [88.191.118.219]) by mx.google.com with ESMTPS id t55si2512848wec.113.2011.10.14.02.58.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Oct 2011 02:58:53 -0700 (PDT) Received-SPF: pass (google.com: domain of lool@dooz.org designates 88.191.118.219 as permitted sender) client-ip=88.191.118.219; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lool@dooz.org designates 88.191.118.219 as permitted sender) smtp.mail=lool@dooz.org Received: from bee.dooz.org (unknown [IPv6:2a01:e35:8a6e:5e80:224:7eff:fe14:65c3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bee.dooz.org", Issuer "dooz.org CA" (verified OK)) by pig2.dooz.org (Postfix) with ESMTPS id 052BAC027F for ; Fri, 14 Oct 2011 11:58:53 +0200 (CEST) Received: by bee.dooz.org (Postfix, from userid 1000) id 46E7B29C7; Fri, 14 Oct 2011 11:58:51 +0200 (CEST) Resent-From: =?iso-8859-1?Q?Lo=EFc?= Minier Resent-Date: Fri, 14 Oct 2011 11:58:51 +0200 Resent-Message-ID: <20111014095851.GF27642@bee.dooz.org> Resent-To: patches@linaro.org X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-26) on pig.dooz.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=3.0 tests=BAYES_00, USER_IN_WHITELIST autolearn=disabled version=3.1.4 X-Original-To: lool@dooz.org Received: from mail-ww0-f49.google.com (mail-ww0-f49.google.com [74.125.82.49]) by pig.dooz.org (Postfix) with ESMTP id 88F594C0A9 for ; Fri, 14 Oct 2011 00:10:55 +0200 (CEST) Received: by wwg9 with SMTP id 9so270849wwg.30 for ; Thu, 13 Oct 2011 15:10:55 -0700 (PDT) Received: by 10.227.196.12 with SMTP id ee12mr1922709wbb.42.1318543611789; Thu, 13 Oct 2011 15:06:51 -0700 (PDT) X-Forwarded-To: lool@dooz.org X-X-Forwarded-For: loic.minier@linaro.org lool@dooz.org Received: by 10.180.105.167 with SMTP id gn7cs168669wib; Thu, 13 Oct 2011 15:06:51 -0700 (PDT) Received: by 10.204.15.212 with SMTP id l20mr4516982bka.74.1318543611081; Thu, 13 Oct 2011 15:06:51 -0700 (PDT) Received: from pig2.dooz.org (pig2.dooz.org. [88.191.118.219]) by mx.google.com with ESMTPS id m3si3754281bke.9.2011.10.13.15.06.50 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Oct 2011 15:06:51 -0700 (PDT) Received-SPF: pass (google.com: domain of lool@bee.dooz.org designates 88.191.118.219 as permitted sender) client-ip=88.191.118.219; Received: from bee.dooz.org (unknown [IPv6:2a01:e35:8a6e:5e80:224:7eff:fe14:65c3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bee.dooz.org", Issuer "dooz.org CA" (verified OK)) by pig2.dooz.org (Postfix) with ESMTPS id 8002DC061D; Fri, 14 Oct 2011 00:06:50 +0200 (CEST) Received: by bee.dooz.org (Postfix, from userid 1000) id 2072B3991; Fri, 14 Oct 2011 00:06:48 +0200 (CEST) From: =?UTF-8?q?Lo=C3=AFc=20Minier?= To: barebox@lists.infradead.org Cc: =?UTF-8?q?Lo=C3=AFc=20Minier?= Subject: [PATCH 3/5] fprintf() returns an int Date: Fri, 14 Oct 2011 00:06:39 +0200 Message-Id: <1318543601-20819-4-git-send-email-loic.minier@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1318543601-20819-1-git-send-email-loic.minier@linaro.org> References: <1318543601-20819-1-git-send-email-loic.minier@linaro.org> MIME-Version: 1.0 For consistency, let fprintf return an int just like it's regular libc implementation and all the other printf variations barebox has. This also fixes a warning on variable i being never read in the function. Signed-off-by: Loïc Minier --- common/console.c | 4 +++- include/stdio.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/console.c b/common/console.c index 06e9c29..0d2a33b 100644 --- a/common/console.c +++ b/common/console.c @@ -327,7 +327,7 @@ void console_flush(void) } EXPORT_SYMBOL(console_flush); -void fprintf (int file, const char *fmt, ...) +int fprintf (int file, const char *fmt, ...) { va_list args; uint i; @@ -343,6 +343,8 @@ void fprintf (int file, const char *fmt, ...) /* Print the string */ fputs (file, printbuffer); + + return i; } EXPORT_SYMBOL(fprintf); diff --git a/include/stdio.h b/include/stdio.h index a0d81d3..0c68fa8 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -54,7 +54,7 @@ int vscnprintf(char *buf, size_t size, const char *fmt, va_list args); #define stderr 2 #define MAX_FILES 128 -void fprintf(int file, const char *fmt, ...) __attribute__ ((format(__printf__, 2, 3))); +int fprintf(int file, const char *fmt, ...) __attribute__ ((format(__printf__, 2, 3))); int fputs(int file, const char *s); int fputc(int file, const char c); int ftstc(int file);