Skip to contentSkip to conversation

MIPS: BCM47XX: Use __initdata for the bcm47xx_leds_pdata

PATCH In review Rafał Miłecki 3 participants 4 messages Mar 23, 2018 – Apr 24, 2018

Subsystems (2)
lore
Share & tools
lore

Rafał Miłecki

author maintainer
#0 lore raw

PATCH 1/1 MIPS: BCM47XX: Use __initdata for the bcm47xx_leds_pdata

From: Rafał Miłecki <[email protected]>

This struct variable is used during init only. It gets passed to the gpio_led_register_device() which creates its own data copy. That allows using __initdata and saving some minimal amount of memory.

---
 arch/mips/bcm47xx/leds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/bcm47xx/leds.c +1 -1
index 8307a8a02667..fb87a6c54bc9 100644
@@ -521,7 +521,7 @@ bcm47xx_leds_simpletech_simpleshare[] __initconst = {
  * Init
  **************************************************/
 
-static struct gpio_led_platform_data bcm47xx_leds_pdata;
+static struct gpio_led_platform_data bcm47xx_leds_pdata __initdata;
 
 #define bcm47xx_set_pdata(dev_leds) do {				\
 	bcm47xx_leds_pdata.leds = dev_leds;				\
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 7 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

This struct variable is used during init only. It gets passed to the gpio_led_register_device() which creates its own data copy. That allows using __initdata and saving some minimal amount of memory.

A.

Quoted 21 lines
---
 arch/mips/bcm47xx/leds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/bcm47xx/leds.c +1 -1
index 8307a8a02667..fb87a6c54bc9 100644
@@ -521,7 +521,7 @@ bcm47xx_leds_simpletech_simpleshare[] __initconst = {
  * Init
  **************************************************/
 
-static struct gpio_led_platform_data bcm47xx_leds_pdata;
+static struct gpio_led_platform_data bcm47xx_leds_pdata __initdata;
 
 #define bcm47xx_set_pdata(dev_leds) do {				\
 	bcm47xx_leds_pdata.leds = dev_leds;				\
Signature · 1 line
2.11.0
#3 lore raw
Quoted 10 lines · Rafał Miłecki
Quoted 7 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

This struct variable is used during init only. It gets passed to the gpio_led_register_device() which creates its own data copy. That allows using __initdata and saving some minimal amount of memory.

James, would you care to take this trivial patch?

Yes, applied for 4.18

Thanks
James