Patchwork [U-Boot] cfb_console: fix build breakage

login
register
mail settings
Submitter Andreas Bießmann
Date July 29, 2011, 7:10 a.m.
Message ID <1311923413-62087-1-git-send-email-andreas.devel@googlemail.com>
Download mbox | patch
Permalink /patch/107355/
State Accepted
Headers show

Comments

Andreas Bießmann - July 29, 2011, 7:10 a.m.
Commit 09c2e90c110ef99f1203685acd1059114a51b167 "unify version_string"
introduced a build breakage in cfb_console.c

---8<---
cfb_console.c:1497: warning: format '%s' expects type 'char *', but
argument 3 has type 'const char (*)[]'
--->8---

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
---
 drivers/video/cfb_console.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Wolfgang Denk - July 29, 2011, 9:28 a.m.
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

In message <1311923413-62087-1-git-send-email-andreas.devel@googlemail.com> you wrote:
> Commit 09c2e90c110ef99f1203685acd1059114a51b167 "unify version_string"
> introduced a build breakage in cfb_console.c
> 
> ---8<---
> cfb_console.c:1497: warning: format '%s' expects type 'char *', but
> argument 3 has type 'const char (*)[]'
> --->8---
> 
> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
> ---
>  drivers/video/cfb_console.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
Sergei Shtylyov - July 29, 2011, 12:32 p.m.
Hello.

On 29-07-2011 11:10, Andreas Bießmann wrote:

> Commit 09c2e90c110ef99f1203685acd1059114a51b167 "unify version_string"
> introduced a build breakage in cfb_console.c

> ---8<---
> cfb_console.c:1497: warning: format '%s' expects type 'char *', but
> argument 3 has type 'const char (*)[]'
> --->8---

> Signed-off-by: Andreas Bießmann<andreas.devel@googlemail.com>
> ---
>   drivers/video/cfb_console.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)

> diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
> index 77e7285..b56197f 100644
> --- a/drivers/video/cfb_console.c
> +++ b/drivers/video/cfb_console.c
> @@ -1494,7 +1494,7 @@ static void *video_logo (void)
>
>   	logo_plot (video_fb_address, VIDEO_COLS, 0, 0);
>
> -	sprintf (info, " %s",&version_string);
> +	sprintf (info, " %s", version_string);

    This wouldn't pass checkpatch.pl -- remove the space before paren.

WBR, Sergei
Wolfgang Denk - July 29, 2011, 7:48 p.m.
Dear Sergei Shtylyov,

In message <4E32A86D.1010701@mvista.com> you wrote:
> 
> > diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
> > index 77e7285..b56197f 100644
> > --- a/drivers/video/cfb_console.c
> > +++ b/drivers/video/cfb_console.c
> > @@ -1494,7 +1494,7 @@ static void *video_logo (void)
> >
> >   	logo_plot (video_fb_address, VIDEO_COLS, 0, 0);
> >
> > -	sprintf (info, " %s",&version_string);
> > +	sprintf (info, " %s", version_string);
> 
>     This wouldn't pass checkpatch.pl -- remove the space before paren.

Yes, you are right.  But this patch is just intended to fix the
compile problem.

Cleanup patches for this file will follow soon :-)

Best regards,

Wolfgang Denk
Wolfgang Denk - July 29, 2011, 7:55 p.m.
The following 3 patches will clean up cfb_console.c
so that future patches are more likely to pass checkpatch without
problems.

The following warnings will not be fixed:

WARNING: externs should be avoided in .c files

WARNING: consider using strict_strtoul in preference to simple_strtoul


Best regards,

Wolfgang Denk

Patch

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 77e7285..b56197f 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -1494,7 +1494,7 @@  static void *video_logo (void)
 
 	logo_plot (video_fb_address, VIDEO_COLS, 0, 0);
 
-	sprintf (info, " %s", &version_string);
+	sprintf (info, " %s", version_string);
 
 	space = (VIDEO_LINE_LEN / 2 - VIDEO_INFO_X) / VIDEO_FONT_WIDTH;
 	len = strlen(info);