diff mbox

[U-Boot,1/3] common/memsize.c: Coding style cleanup

Message ID 1413922451-29726-1-git-send-email-wd@denx.de
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Wolfgang Denk Oct. 21, 2014, 8:14 p.m. UTC
Prepare code to make later modifications checkpatch-clean.

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 common/memsize.c | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

Comments

Tom Rini Jan. 15, 2015, 2:57 p.m. UTC | #1
On Tue, Oct 21, 2014 at 10:14:10PM +0200, Wolfgang Denk wrote:

> Prepare code to make later modifications checkpatch-clean.
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/memsize.c b/common/memsize.c
index 589400d..0fb9ba5 100644
--- a/common/memsize.c
+++ b/common/memsize.c
@@ -33,43 +33,46 @@  long get_ram_size(long *base, long maxsize)
 	long           size;
 	int            i = 0;
 
-	for (cnt = (maxsize / sizeof (long)) >> 1; cnt > 0; cnt >>= 1) {
+	for (cnt = (maxsize / sizeof(long)) >> 1; cnt > 0; cnt >>= 1) {
 		addr = base + cnt;	/* pointer arith! */
-		sync ();
+		sync();
 		save[i++] = *addr;
-		sync ();
+		sync();
 		*addr = ~cnt;
 	}
 
 	addr = base;
-	sync ();
+	sync();
 	save[i] = *addr;
-	sync ();
+	sync();
 	*addr = 0;
 
-	sync ();
+	sync();
 	if ((val = *addr) != 0) {
-		/* Restore the original data before leaving the function.
-		 */
-		sync ();
+		/* Restore the original data before leaving the function. */
+		sync();
 		*addr = save[i];
 		for (cnt = 1; cnt < maxsize / sizeof(long); cnt <<= 1) {
 			addr  = base + cnt;
-			sync ();
+			sync();
 			*addr = save[--i];
 		}
 		return (0);
 	}
 
-	for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1) {
+	for (cnt = 1; cnt < maxsize / sizeof(long); cnt <<= 1) {
 		addr = base + cnt;	/* pointer arith! */
 		val = *addr;
 		*addr = save[--i];
 		if (val != ~cnt) {
-			size = cnt * sizeof (long);
-			/* Restore the original data before leaving the function.
+			size = cnt * sizeof(long);
+			/*
+			 * Restore the original data
+			 * before leaving the function.
 			 */
-			for (cnt <<= 1; cnt < maxsize / sizeof (long); cnt <<= 1) {
+			for (cnt <<= 1;
+			     cnt < maxsize / sizeof(long);
+			     cnt <<= 1) {
 				addr  = base + cnt;
 				*addr = save[--i];
 			}