Patchwork [U-Boot,3/3] cfb_console.c: checkpatch cleanup

login
register
mail settings
Submitter Wolfgang Denk
Date July 29, 2011, 7:55 p.m.
Message ID <1311969329-1109-4-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/107449/
State Superseded
Headers show

Comments

Wolfgang Denk - July 29, 2011, 7:55 p.m.
Fix the following:

ERROR: do not initialise statics to 0 or NULL
ERROR: do not use assignment in if condition

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 drivers/video/cfb_console.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
Sergei Shtylyov - July 30, 2011, 2:12 p.m.
Hello.

On 29-07-2011 23:55, Wolfgang Denk wrote:

> Fix the following:

> ERROR: do not initialise statics to 0 or NULL
> ERROR: do not use assignment in if condition

> Signed-off-by: Wolfgang Denk<wd@denx.de>
> ---
>   drivers/video/cfb_console.c |   16 ++++++++++------
>   1 files changed, 10 insertions(+), 6 deletions(-)

> diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
> index d2dd421..6e9143e 100644
> --- a/drivers/video/cfb_console.c
> +++ b/drivers/video/cfb_console.c
[...]
> @@ -1648,7 +1651,8 @@ static int video_init(void)
>   {
>   	unsigned char color8;
>
> -	if ((pGD = video_hw_init()) == NULL)
> +	pGD = video_hw_init()) == ;

    Did you try to compile this? :-)

WBR, Sergei
Wolfgang Denk - July 30, 2011, 10:45 p.m.
Dear Sergei,

In message <4E341151.8080309@mvista.com> you wrote:
> 
> > -	if ((pGD = video_hw_init()) == NULL)
> > +	pGD = video_hw_init()) == ;
> 
>     Did you try to compile this? :-)

Heh.  What's your guess?

Sorry, will send update.

Sergei, for quite some time you have been performing continuous and
thorough error checking on a large number of patches.  I know this is
an ungrateful job - but an important one.  I would like to say that I
appreciate the work you are doing, and: thanks!

Best regards,

Wolfgang Denk

Patch

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index d2dd421..6e9143e 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -366,8 +366,8 @@  static void *video_console_address;	/* console buffer start address */
 
 static int video_logo_height = VIDEO_LOGO_HEIGHT;
 
-static int console_col = 0;	/* cursor col */
-static int console_row = 0;	/* cursor row */
+static int console_col;		/* cursor col */
+static int console_row;		/* cursor row */
 
 static u32 eorx, fgx, bgx;	/* color pats */
 
@@ -1559,18 +1559,21 @@  static void *video_logo(void)
 	char *s;
 	ulong addr;
 
-	if ((s = getenv("splashimage")) != NULL) {
+	s = getenv("splashimage");
+	if (s != NULL) {
 		int x = 0, y = 0;
 
 		addr = simple_strtoul(s, NULL, 16);
 #ifdef CONFIG_SPLASH_SCREEN_ALIGN
-		if ((s = getenv("splashpos")) != NULL) {
+		s = getenv("splashpos");
+		if ((s != NULL) {
 			if (s[0] == 'm')
 				x = BMP_ALIGN_CENTER;
 			else
 				x = simple_strtol(s, NULL, 0);
 
-			if ((s = strchr(s + 1, ',')) != NULL) {
+			s = strchr(s + 1, ',');
+			if (s != NULL) {
 				if (s[1] == 'm')
 					y = BMP_ALIGN_CENTER;
 				else
@@ -1648,7 +1651,8 @@  static int video_init(void)
 {
 	unsigned char color8;
 
-	if ((pGD = video_hw_init()) == NULL)
+	pGD = video_hw_init()) == ;
+	if (pGD == NULL)
 		return -1;
 
 	video_fb_address = (void *) VIDEO_FB_ADRS;