Skip to content

Commit 94f0b39

Browse files
committed
hwmon: (fam15h_power) Use topology_core_id()
Use the provided topology helper function instead of fiddling in cpu_data. Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Juergen Gross <[email protected]> Tested-by: Sohil Mehta <[email protected]> Tested-by: Michael Kelley <[email protected]> Tested-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Zhang Rui <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0925367 commit 94f0b39

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/hwmon/fam15h_power.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/cpumask.h>
1818
#include <linux/time.h>
1919
#include <linux/sched.h>
20+
#include <linux/topology.h>
2021
#include <asm/processor.h>
2122
#include <asm/msr.h>
2223

@@ -134,15 +135,13 @@ static DEVICE_ATTR_RO(power1_crit);
134135
static void do_read_registers_on_cu(void *_data)
135136
{
136137
struct fam15h_power_data *data = _data;
137-
int cpu, cu;
138-
139-
cpu = smp_processor_id();
138+
int cu;
140139

141140
/*
142141
* With the new x86 topology modelling, cpu core id actually
143142
* is compute unit id.
144143
*/
145-
cu = cpu_data(cpu).cpu_core_id;
144+
cu = topology_core_id(smp_processor_id());
146145

147146
rdmsrl_safe(MSR_F15H_CU_PWR_ACCUMULATOR, &data->cu_acc_power[cu]);
148147
rdmsrl_safe(MSR_F15H_PTSC, &data->cpu_sw_pwr_ptsc[cu]);

0 commit comments

Comments
 (0)