[MIPS] SB1250: Fix bugs/warnings by creative use of volatile.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Ralf Baechle
2007-03-24 14:26:13 +00:00
parent 41a8198f61
commit 8fb303c7f1
7 changed files with 18 additions and 17 deletions

View File

@@ -169,17 +169,19 @@ void __init plat_mem_setup(void)
#define LEDS_PHYS MLEDS_PHYS
#endif
#define setled(index, c) \
((unsigned char *)(IOADDR(LEDS_PHYS)+0x20))[(3-(index))<<3] = (c)
void setleds(char *str)
{
void *reg;
int i;
for (i = 0; i < 4; i++) {
if (!str[i]) {
setled(i, ' ');
} else {
setled(i, str[i]);
}
reg = IOADDR(LEDS_PHYS) + 0x20 + ((3 - i) << 3);
if (!str[i])
writeb(' ', reg);
else
writeb(str[i], reg);
}
}
#endif
#endif /* LEDS_PHYS */