aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <guenter.roeck@ericsson.com>2011-05-23 15:06:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-23 14:59:08 -0400
commitbb74e8ca352eecefdc5c1a9ebab01f18aa2f6f3c (patch)
treea57fdd270cf3e41e2de501074d3ac8558cd9b7c2 /drivers/hwmon
parent30cb6d5f2eb24d15d20139d5ceefaccc68734bd7 (diff)
hwmon: (coretemp) Fix compile error if CONFIG_SMP is not defined
cpu_sibling_mask() is not defined unless CONFIG_SMP is defined, so it must not be used directly in the code without ifdef protection. To solve the problem and avoid ifdefs in the code, define for_each_sibling() and use it instead. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/coretemp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 5c7cd60d5f9d..a00245eb3fa0 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -51,10 +51,12 @@
51#define TO_PHYS_ID(cpu) cpu_data(cpu).phys_proc_id 51#define TO_PHYS_ID(cpu) cpu_data(cpu).phys_proc_id
52#define TO_CORE_ID(cpu) cpu_data(cpu).cpu_core_id 52#define TO_CORE_ID(cpu) cpu_data(cpu).cpu_core_id
53#define TO_ATTR_NO(cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO) 53#define TO_ATTR_NO(cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)
54#define for_each_sibling(i, cpu) for_each_cpu(i, cpu_sibling_mask(cpu))
54#else 55#else
55#define TO_PHYS_ID(cpu) (cpu) 56#define TO_PHYS_ID(cpu) (cpu)
56#define TO_CORE_ID(cpu) (cpu) 57#define TO_CORE_ID(cpu) (cpu)
57#define TO_ATTR_NO(cpu) (cpu) 58#define TO_ATTR_NO(cpu) (cpu)
59#define for_each_sibling(i, cpu) for (i = 0; false; )
58#endif 60#endif
59 61
60/* 62/*
@@ -762,7 +764,7 @@ static void __cpuinit put_core_offline(unsigned int cpu)
762 coretemp_remove_core(pdata, &pdev->dev, indx); 764 coretemp_remove_core(pdata, &pdev->dev, indx);
763 765
764 /* Online the HT version of this core, if any */ 766 /* Online the HT version of this core, if any */
765 for_each_cpu(i, cpu_sibling_mask(cpu)) { 767 for_each_sibling(i, cpu) {
766 if (i != cpu) { 768 if (i != cpu) {
767 get_core_online(i); 769 get_core_online(i);
768 break; 770 break;