mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/6] cfi_flash_new: make code more readable, return is not a function
Date: Mon,  8 Feb 2010 14:47:30 +0100	[thread overview]
Message-ID: <1265636852-19054-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1265636852-19054-4-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/nor/cfi_flash_new.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/nor/cfi_flash_new.c b/drivers/nor/cfi_flash_new.c
index f9306cb..88432c8 100644
--- a/drivers/nor/cfi_flash_new.c
+++ b/drivers/nor/cfi_flash_new.c
@@ -123,7 +123,6 @@ static int flash_write_cfiword (flash_info_t * info, ulong dest,
 	ctladdr.cp = flash_make_addr (info, 0, 0);
 	cptr.cp = (uchar *) dest;
 
-
 	/* Check if Flash is (sufficiently) erased */
 	if (bankwidth_is_1(info)) {
 		flag = ((cptr.cp[0] & cword.c) == cword.c);
@@ -488,7 +487,7 @@ static ulong flash_get_size (flash_info_t *info, ulong base)
 	}
 
 	flash_write_cmd (info, 0, 0, info->cmd_reset);
-	return (info->size);
+	return info->size;
 }
 
 /* loop through the sectors from the highest address
@@ -563,7 +562,9 @@ static int write_buff (flash_info_t * info, const uchar * src, ulong addr, ulong
 		}
 		for (; (cnt == 0) && (i < info->portwidth); ++i, ++cp)
 			flash_add_byte (info, &cword, (*(uchar *) cp));
-		if ((rc = flash_write_cfiword (info, wp, cword)) != 0)
+
+		rc = flash_write_cfiword (info, wp, cword);
+		if (rc)
 			return rc;
 		wp = cp;
 	}
@@ -609,7 +610,7 @@ static int write_buff (flash_info_t * info, const uchar * src, ulong addr, ulong
 	}
 #endif /* CONFIG_CFI_BUFFER_WRITE */
 	if (cnt == 0) {
-		return (0);
+		return 0;
 	}
 
 	/*
-- 
1.6.6


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

  reply	other threads:[~2010-02-08 13:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08 13:47 Clean up flash driver confusion Sascha Hauer
2010-02-08 13:47 ` [PATCH 1/6] cfi_flash_new: Fix Intel chips Sascha Hauer
2010-02-08 13:47   ` [PATCH 2/6] cfi_flash_new: Safe indention level by bailing out earlier in error case Sascha Hauer
2010-02-08 13:47     ` [PATCH 3/6] cfi_flash_new: generate flash erase dots in common function Sascha Hauer
2010-02-08 13:47       ` Sascha Hauer [this message]
2010-02-08 13:47         ` [PATCH 5/6] cfi_flash: remove old driver and switch to new one Sascha Hauer
2010-02-08 13:47           ` [PATCH 6/6] cfi_flash: move include/cfi_flash.c next to driver 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=1265636852-19054-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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