Skip to content
Snippets Groups Projects
Commit 95099fee authored by Wolfgang Denk's avatar Wolfgang Denk Committed by Tom Rini
Browse files

common/memsize.c: Coding style cleanup


Prepare code to make later modifications checkpatch-clean.

Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
parent c7cb334d
No related branches found
No related tags found
No related merge requests found
......@@ -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];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment