]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
EDAC/skx_common: Use topology_physical_package_id() instead of open coding
authorQiuxu Zhuo <qiuxu.zhuo@intel.com>
Wed, 3 Sep 2025 03:06:48 +0000 (11:06 +0800)
committerTony Luck <tony.luck@intel.com>
Wed, 3 Sep 2025 14:48:01 +0000 (07:48 -0700)
Use topology_physical_package_id() to get the CPU package ID instead of
open coding.

Suggested-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20250903030648.3285935-1-qiuxu.zhuo@intel.com
drivers/edac/skx_common.c

index 5899a1110495515bffaab52aeff6e66ed3548091..724842f512acacfba16ce7b1bbf620e020046c1f 100644 (file)
@@ -14,6 +14,7 @@
  * Copyright (c) 2018, Intel Corporation.
  */
 
+#include <linux/topology.h>
 #include <linux/acpi.h>
 #include <linux/dmi.h>
 #include <linux/adxl.h>
@@ -278,7 +279,7 @@ static int skx_get_pkg_id(struct skx_dev *d, u8 *id)
                        struct cpuinfo_x86 *c = &cpu_data(cpu);
 
                        if (c->initialized && cpu_to_node(cpu) == node) {
-                               *id = c->topo.pkg_id;
+                               *id = topology_physical_package_id(cpu);
                                return 0;
                        }
                }