Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: w35und: make led lookup tables static

Impact: cleanup

No need to keep read-only data on the stack.

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Pekka Enberg and committed by
Greg Kroah-Hartman
833d0cd3 7c49a0ac

+12 -5
+12 -5
drivers/staging/winbond/wbusb.c
··· 171 171 .get_tsf = wbsoft_get_tsf, 172 172 }; 173 173 174 + static u8 LED_GRAY[20] = { 175 + 0, 3, 4, 6, 8, 10, 11, 12, 13, 14, 15, 14, 13, 12, 11, 10, 8, 6, 4, 2 176 + }; 177 + 178 + static u8 LED_GRAY2[30] = { 179 + 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180 + 0, 15, 14, 13, 12, 11, 10, 9, 8 181 + }; 182 + 174 183 static void hal_led_control(unsigned long data) 175 184 { 176 185 struct wbsoft_priv *adapter = (struct wbsoft_priv *)data; 177 186 struct hw_data *pHwData = &adapter->sHwData; 178 187 struct wb35_reg *reg = &pHwData->reg; 179 188 u32 LEDSet = (pHwData->SoftwareSet & HAL_LED_SET_MASK) >> HAL_LED_SET_SHIFT; 180 - u8 LEDgray[20] = { 0, 3, 4, 6, 8, 10, 11, 12, 13, 14, 15, 14, 13, 12, 11, 10, 8, 6, 4, 2 }; 181 - u8 LEDgray2[30] = { 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 14, 13, 12, 11, 10, 9, 8 }; 182 189 u32 TimeInterval = 500, ltmp, ltmp2; 183 190 ltmp = 0; 184 191 ··· 294 287 // 20060901 Gray blinking if in disconnect state and not scanning 295 288 ltmp = reg->U1BC_LEDConfigure; 296 289 reg->U1BC_LEDConfigure &= ~0x1f; 297 - if (LEDgray2[(pHwData->LED_Blinking % 30)]) { 290 + if (LED_GRAY2[(pHwData->LED_Blinking % 30)]) { 298 291 reg->U1BC_LEDConfigure |= 0x10; 299 292 reg->U1BC_LEDConfigure |= 300 - LEDgray2[(pHwData->LED_Blinking % 30)]; 293 + LED_GRAY2[(pHwData->LED_Blinking % 30)]; 301 294 } 302 295 pHwData->LED_Blinking++; 303 296 if (reg->U1BC_LEDConfigure != ltmp) ··· 383 376 reg->U1BC_LEDConfigure &= ~0x0f; 384 377 reg->U1BC_LEDConfigure |= 0x10; 385 378 reg->U1BC_LEDConfigure |= 386 - LEDgray[(pHwData->LED_Blinking - 1) % 20]; 379 + LED_GRAY[(pHwData->LED_Blinking - 1) % 20]; 387 380 Wb35Reg_Write(pHwData, 0x03bc, 388 381 reg->U1BC_LEDConfigure); 389 382