Skip to contentSkip to conversation

topology: Fix cpumask_of_node macro for CONFIG_NEED_MULTIPLE_NODES=n

PATCH In review Guenter Roeck 2 participants 2 messages May 26, 2020 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 topology: Fix cpumask_of_node macro for CONFIG_NEED_MULTIPLE_NODES=n

The following compile error is seen in linux-next if NUMA=n and CONFIG_NEED_MULTIPLE_NODES=n.

CC drivers/hwmon/amd_energy.o
In file included from ../arch/x86/include/asm/cpumask.h:5:0,

                 from ../arch/x86/include/asm/msr.h:11,
                 from ../arch/x86/include/asm/processor.h:22,
                 from ../arch/x86/include/asm/cpu_device_id.h:16,
                 from ../drivers/hwmon/amd_energy.c:6:
../drivers/hwmon/amd_energy.c: In function 'amd_energy_read':
../include/asm-generic/topology.h:51:36: error:
			void value not ignored as it ought to be
     #define cpumask_of_node(node) ((void)node, cpu_online_mask)
../include/linux/cpumask.h:618:72: note:
			in definition of macro 'cpumask_first_and'
 #define cpumask_first_and(src1p, src2p) cpumask_next_and(-1, (src1p), (src2p))
                                                                        ^~~~~

../drivers/hwmon/amd_energy.c:194:6: note: in expansion of macro 'cpumask_of_node'

cpumask_of_node() is missing () around the 'node' parameter.

Fixes b339752d054f ("cpumask: fix spurious cpumask_of_node() on non-NUMA multi-node configs")
Cc Tejun Heo <[email protected]>
---
 include/asm-generic/topology.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/topology.h +1 -1
index 238873739550..5aa8705df87e 100644
@@ -48,7 +48,7 @@
   #ifdef CONFIG_NEED_MULTIPLE_NODES
     #define cpumask_of_node(node)	((node) == 0 ? cpu_online_mask : cpu_none_mask)
   #else
-    #define cpumask_of_node(node)	((void)node, cpu_online_mask)
+    #define cpumask_of_node(node)	((void)(node), cpu_online_mask)
   #endif
 #endif
 #ifndef pcibus_to_node
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · Guenter Roeck

The following compile error is seen in linux-next if NUMA=n and CONFIG_NEED_MULTIPLE_NODES=n.

CC drivers/hwmon/amd_energy.o
In file included from ../arch/x86/include/asm/cpumask.h:5:0,

                 from ../arch/x86/include/asm/msr.h:11,
                 from ../arch/x86/include/asm/processor.h:22,
                 from ../arch/x86/include/asm/cpu_device_id.h:16,
                 from ../drivers/hwmon/amd_energy.c:6:
../drivers/hwmon/amd_energy.c: In function 'amd_energy_read':
../include/asm-generic/topology.h:51:36: error:
			void value not ignored as it ought to be
     #define cpumask_of_node(node) ((void)node, cpu_online_mask)
../include/linux/cpumask.h:618:72: note:
			in definition of macro 'cpumask_first_and'
 #define cpumask_first_and(src1p, src2p) cpumask_next_and(-1, (src1p), (src2p))
                                                                        ^~~~~
Quoted 8 lines

../drivers/hwmon/amd_energy.c:194:6: note: in expansion of macro 'cpumask_of_node'

cpumask_of_node() is missing () around the 'node' parameter.

Fixes b339752d054f ("cpumask: fix spurious cpumask_of_node() on non-NUMA multi-node configs")
Cc Tejun Heo <[email protected]>

Thanks.

Quoted 18 lines
---
 include/asm-generic/topology.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/topology.h +1 -1
index 238873739550..5aa8705df87e 100644
@@ -48,7 +48,7 @@
   #ifdef CONFIG_NEED_MULTIPLE_NODES
     #define cpumask_of_node(node)	((node) == 0 ? cpu_online_mask : cpu_none_mask)
   #else
-    #define cpumask_of_node(node)	((void)node, cpu_online_mask)
+    #define cpumask_of_node(node)	((void)(node), cpu_online_mask)
   #endif
 #endif
 #ifndef pcibus_to_node
Signature · 1 line
~Randy