summaryrefslogtreecommitdiff
path: root/common/memsize.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2014-10-21 22:14:10 +0200
committerTom Rini <trini@ti.com>2015-01-14 11:35:43 -0500
commit95099fee404024d3f150827da755b7b487be5ba8 (patch)
tree821cdc6c60cd261f09845a46cabbfbf7c4b3ea7a /common/memsize.c
parentc7cb334d1490a891a1f145a9daea2ed2376a2ca3 (diff)
downloadu-boot-imx-95099fee404024d3f150827da755b7b487be5ba8.zip
u-boot-imx-95099fee404024d3f150827da755b7b487be5ba8.tar.gz
u-boot-imx-95099fee404024d3f150827da755b7b487be5ba8.tar.bz2
common/memsize.c: Coding style cleanup
Prepare code to make later modifications checkpatch-clean. Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'common/memsize.c')
-rw-r--r--common/memsize.c31
1 files changed, 17 insertions, 14 deletions
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];
}