From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/4] Make fprintf return number of bytes written
Date: Fri, 11 Nov 2011 11:39:02 -0200 [thread overview]
Message-ID: <CAMOw1v4GiEqYu=t_vTPwNoU-U9nxhrE+SNOwh1H30=dYswm2Xg@mail.gmail.com> (raw)
In-Reply-To: <20111111112738.GQ16886@pengutronix.de>
On Fri, Nov 11, 2011 at 9:27 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Wed, Nov 09, 2011 at 07:39:54PM -0200, Lucas De Marchi wrote:
>> Return number of bytes written, like its siblings function. This also
>> removes the warning below on gcc >= 4.6.
>>
>> common/console.c:333:7: warning: variable ‘i’ set but not used
>> [-Wunused-but-set-variable]
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
>> ---
>> common/console.c | 4 +++-
>> common/console_simple.c | 4 +++-
>> include/stdio.h | 2 +-
>> 3 files changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/common/console.c b/common/console.c
>> index 06e9c29..7f2810e 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;
>> }
>
> I just applied another patch I suggested earlier which fixes the return
> value of the various puts functions. With this I suggest returning the
> return value of fputs here instead of a bogus 1.
It makes sense. Thanks
Lucas De Marchi
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-11-11 13:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-09 21:39 [PATCH 0/4] Fixes for x86 Lucas De Marchi
2011-11-09 21:39 ` [PATCH 1/4] Make fprintf return number of bytes written Lucas De Marchi
2011-11-10 10:53 ` Marc Kleine-Budde
2011-11-10 13:15 ` Lucas De Marchi
2011-11-10 13:20 ` Marc Kleine-Budde
2011-11-11 11:27 ` Sascha Hauer
2011-11-11 13:39 ` Lucas De Marchi [this message]
2011-11-09 21:39 ` [PATCH 2/4] Add setupmbr to gitignore Lucas De Marchi
2011-11-09 21:39 ` [PATCH 3/4] x86: fix build error because of missing header Lucas De Marchi
2011-11-09 21:39 ` [PATCH 4/4] x86: fix symbol size calculation Lucas De Marchi
2011-11-11 11:29 ` [PATCH 0/4] Fixes for x86 Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMOw1v4GiEqYu=t_vTPwNoU-U9nxhrE+SNOwh1H30=dYswm2Xg@mail.gmail.com' \
--to=lucas.demarchi@profusion.mobi \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox