All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3 v2] cfb_console.c: checkpatch cleanup
Date: Sun, 31 Jul 2011 00:48:09 +0200	[thread overview]
Message-ID: <1312066089-16812-1-git-send-email-wd@denx.de> (raw)
In-Reply-To: <1311969329-1109-4-git-send-email-wd@denx.de>

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>
---
Changes:

v2:	Fix compile error / incomplete edit

 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
@@ -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;
-- 
1.7.6

  parent reply	other threads:[~2011-07-30 22:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29  7:10 [U-Boot] [PATCH] cfb_console: fix build breakage Andreas Bießmann
2011-07-29  9:28 ` Wolfgang Denk
2011-07-29 12:32 ` Sergei Shtylyov
2011-07-29 19:48   ` Wolfgang Denk
2011-07-29 19:55 ` [U-Boot] [PATCH 0/3] cfb_console.c - coding style cleanup Wolfgang Denk
2011-07-29 19:55   ` [U-Boot] [PATCH 1/3] Cosmetic: reformat drivers/video/cfb_console.c Wolfgang Denk
2011-08-01 13:14     ` Wolfgang Denk
2011-07-29 19:55   ` [U-Boot] [PATCH 2/3] cfb_console.c: drop custom PRINTD() and use debug() instead Wolfgang Denk
2011-08-01 13:15     ` Wolfgang Denk
2011-07-29 19:55   ` [U-Boot] [PATCH 3/3] cfb_console.c: checkpatch cleanup Wolfgang Denk
2011-07-30 14:12     ` Sergei Shtylyov
2011-07-30 22:45       ` Wolfgang Denk
2011-07-30 22:48     ` Wolfgang Denk [this message]
2011-08-01 13:17       ` [U-Boot] [PATCH 3/3 v2] " Wolfgang Denk

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=1312066089-16812-1-git-send-email-wd@denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.