diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-03-24 17:26:13 +0300 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-03-24 20:01:50 +0300 |
commit | 8fb303c7f1118b0a82aa08e33429adf9b5ad192c (patch) | |
tree | f0da545839b23136dd2dd167125d3c4bef920348 /arch/mips/sibyte/swarm | |
parent | 41a8198f61d858bcad7ef705d5d3ec3e3a8dea4a (diff) | |
download | linux-8fb303c7f1118b0a82aa08e33429adf9b5ad192c.tar.xz |
[MIPS] SB1250: Fix bugs/warnings by creative use of volatile.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/sibyte/swarm')
-rw-r--r-- | arch/mips/sibyte/swarm/setup.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c index defa1f1452ad..83572d8f3e14 100644 --- a/arch/mips/sibyte/swarm/setup.c +++ b/arch/mips/sibyte/swarm/setup.c @@ -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 */ |