diff options
author | Michael Buesch <mb@bu3sch.de> | 2007-09-20 14:13:40 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:52:07 -0400 |
commit | 1a09404a2338163f181d170c7abdc2242b6c6f03 (patch) | |
tree | 090a31041c1e294a2586f12679a17a5329129272 /drivers/net/wireless/b43/leds.c | |
parent | fb8e4444cc8c7719d9947e21a93e2e84bb1b36eb (diff) |
[B43]: Fix sparse warnings.
The remaining warning in phy.c will be fixed later.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/b43/leds.c')
-rw-r--r-- | drivers/net/wireless/b43/leds.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/b43/leds.c b/drivers/net/wireless/b43/leds.c index 535f960412d7..85d965de5791 100644 --- a/drivers/net/wireless/b43/leds.c +++ b/drivers/net/wireless/b43/leds.c | |||
@@ -32,14 +32,13 @@ | |||
32 | static void b43_led_changestate(struct b43_led *led) | 32 | static void b43_led_changestate(struct b43_led *led) |
33 | { | 33 | { |
34 | struct b43_wldev *dev = led->dev; | 34 | struct b43_wldev *dev = led->dev; |
35 | const int index = b43_led_index(led); | 35 | const int index = led->index; |
36 | const u16 mask = (1 << index); | ||
37 | u16 ledctl; | 36 | u16 ledctl; |
38 | 37 | ||
39 | B43_WARN_ON(!(index >= 0 && index < B43_NR_LEDS)); | 38 | B43_WARN_ON(!(index >= 0 && index < B43_NR_LEDS)); |
40 | B43_WARN_ON(!led->blink_interval); | 39 | B43_WARN_ON(!led->blink_interval); |
41 | ledctl = b43_read16(dev, B43_MMIO_GPIO_CONTROL); | 40 | ledctl = b43_read16(dev, B43_MMIO_GPIO_CONTROL); |
42 | ledctl = (ledctl & mask) ? (ledctl & ~mask) : (ledctl | mask); | 41 | ledctl ^= (1 << index); |
43 | b43_write16(dev, B43_MMIO_GPIO_CONTROL, ledctl); | 42 | b43_write16(dev, B43_MMIO_GPIO_CONTROL, ledctl); |
44 | } | 43 | } |
45 | 44 | ||
@@ -70,7 +69,7 @@ static void b43_led_blink_start(struct b43_led *led, unsigned long interval) | |||
70 | static void b43_led_blink_stop(struct b43_led *led, int sync) | 69 | static void b43_led_blink_stop(struct b43_led *led, int sync) |
71 | { | 70 | { |
72 | struct b43_wldev *dev = led->dev; | 71 | struct b43_wldev *dev = led->dev; |
73 | const int index = b43_led_index(led); | 72 | const int index = led->index; |
74 | u16 ledctl; | 73 | u16 ledctl; |
75 | 74 | ||
76 | if (!led->blink_interval) | 75 | if (!led->blink_interval) |
@@ -139,6 +138,7 @@ int b43_leds_init(struct b43_wldev *dev) | |||
139 | 138 | ||
140 | for (i = 0; i < B43_NR_LEDS; i++) { | 139 | for (i = 0; i < B43_NR_LEDS; i++) { |
141 | led = &(dev->leds[i]); | 140 | led = &(dev->leds[i]); |
141 | led->index = i; | ||
142 | led->dev = dev; | 142 | led->dev = dev; |
143 | setup_timer(&led->blink_timer, | 143 | setup_timer(&led->blink_timer, |
144 | b43_led_blink, (unsigned long)led); | 144 | b43_led_blink, (unsigned long)led); |