Skip to contentSkip to conversation

drivers/leds: Replace __get_cpu_var use through this_cpu_ptr

PATCH Christoph Lameter 2 participants 2 messages May 5, 2014 – May 8, 2014 LED

lore
Share & tools
lore
#0 lore raw

Would you merge this patch please?

Use this_cpu_ptr for the address calculation instead of __get_cpu_var.

drivers/leds/trigger/ledtrig-cpu.c +1 -1
Index: linux/drivers/leds/trigger/ledtrig-cpu.c
===================================================================
@@ -47,7 +47,7 @@
  */
 void ledtrig_cpu(enum cpu_led_event ledevt)
 {
-	struct led_trigger_cpu *trig = &__get_cpu_var(cpu_trig);
+	struct led_trigger_cpu *trig = this_cpu_ptr(&cpu_trig);
 
 	/* Locate the correct CPU LED */
 	switch (ledevt) {
#1 lore raw
Quoted 3 lines · Christoph Lameter

Would you merge this patch please?

Sure, I merged it to my my tree
Thanks,
-Bryan

Quoted 18 lines

Use this_cpu_ptr for the address calculation instead of __get_cpu_var.

Index: linux/drivers/leds/trigger/ledtrig-cpu.c
===================================================================

drivers/leds/trigger/ledtrig-cpu.c 2014-04-14 13:24:54.825360977 -0500 renamed from drivers/leds/trigger/ledtrig-cpu.c 2014-04-14 13:24:54.833360823 -0500 +1 -1
@@ -47,7 +47,7 @@
  */
 void ledtrig_cpu(enum cpu_led_event ledevt)
 {
-       struct led_trigger_cpu *trig = &__get_cpu_var(cpu_trig);
+       struct led_trigger_cpu *trig = this_cpu_ptr(&cpu_trig);
 
        /* Locate the correct CPU LED */
        switch (ledevt) {