Skip to content

Commit

Permalink
hwmon: (coretemp) Fix compile error if CONFIG_SMP is not defined
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guenter Roeck authored and Linus Torvalds committed May 23, 2011
1 parent 30cb6d5 commit bb74e8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/hwmon/coretemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
#define TO_PHYS_ID(cpu) cpu_data(cpu).phys_proc_id
#define TO_CORE_ID(cpu) cpu_data(cpu).cpu_core_id
#define TO_ATTR_NO(cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)
#define for_each_sibling(i, cpu) for_each_cpu(i, cpu_sibling_mask(cpu))
#else
#define TO_PHYS_ID(cpu) (cpu)
#define TO_CORE_ID(cpu) (cpu)
#define TO_ATTR_NO(cpu) (cpu)
#define for_each_sibling(i, cpu) for (i = 0; false; )
#endif

/*
Expand Down Expand Up @@ -762,7 +764,7 @@ static void __cpuinit put_core_offline(unsigned int cpu)
coretemp_remove_core(pdata, &pdev->dev, indx);

/* Online the HT version of this core, if any */
for_each_cpu(i, cpu_sibling_mask(cpu)) {
for_each_sibling(i, cpu) {
if (i != cpu) {
get_core_online(i);
break;
Expand Down

0 comments on commit bb74e8c

Please sign in to comment.