mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/4] Make fprintf return number of bytes written
Date: Thu, 10 Nov 2011 11:53:46 +0100	[thread overview]
Message-ID: <4EBBAD3A.5060805@pengutronix.de> (raw)
In-Reply-To: <1320874797-14270-2-git-send-email-lucas.demarchi@profusion.mobi>


[-- Attachment #1.1: Type: text/plain, Size: 2594 bytes --]

On 11/09/2011 10:39 PM, 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]

please use one tab not 8 spaces for indention.

Marc

> 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;
>  }
>  EXPORT_SYMBOL(fprintf);
>  
> diff --git a/common/console_simple.c b/common/console_simple.c
> index 7304d8e..d73af98 100644
> --- a/common/console_simple.c
> +++ b/common/console_simple.c
> @@ -45,7 +45,7 @@ int vprintf (const char *fmt, va_list args)
>  }
>  EXPORT_SYMBOL(vprintf);
>  
> -void fprintf (int file, const char *fmt, ...)
> +int fprintf (int file, const char *fmt, ...)
>  {
>  	va_list args;
>  	uint i;
> @@ -61,6 +61,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);


-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2011-11-10 10:53 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 [this message]
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
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=4EBBAD3A.5060805@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=lucas.demarchi@profusion.mobi \
    /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