All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpumask: guard cpumask_of_node() macro argument
@ 2020-05-27 13:46 Arnd Bergmann
  2020-05-27 14:51 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2020-05-27 13:46 UTC (permalink / raw)
  To: Andrew Morton, Arnd Bergmann, Rusty Russell, Guenter Roeck,
	Naveen Krishna Chatradhi
  Cc: Benjamin Herrenschmidt, Ingo Molnar, Tony Luck, Ralf Baechle,
	Richard Henderson, linux-arch, linux-kernel

drivers/hwmon/amd_energy.c:195:15: error: invalid operands to binary expression ('void' and 'int')
                                        (channel - data->nr_cpus));
                                        ~~~~~~~~~^~~~~~~~~~~~~~~~~
include/asm-generic/topology.h:51:42: note: expanded from macro 'cpumask_of_node'
    #define cpumask_of_node(node)       ((void)node, cpu_online_mask)
                                               ^~~~
include/linux/cpumask.h:618:72: note: expanded from macro 'cpumask_first_and'
 #define cpumask_first_and(src1p, src2p) cpumask_next_and(-1, (src1p), (src2p))
                                                                       ^~~~~

Fixes: f0b848ce6fe9 ("cpumask: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask")
Fixes: 8abee9566b7e ("hwmon: Add amd_energy driver to report energy counters")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/asm-generic/topology.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
index 238873739550..5aa8705df87e 100644
--- a/include/asm-generic/topology.h
+++ b/include/asm-generic/topology.h
@@ -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
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cpumask: guard cpumask_of_node() macro argument
  2020-05-27 13:46 [PATCH] cpumask: guard cpumask_of_node() macro argument Arnd Bergmann
@ 2020-05-27 14:51 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2020-05-27 14:51 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, Rusty Russell, Naveen Krishna Chatradhi,
	Benjamin Herrenschmidt, Ingo Molnar, Tony Luck, Ralf Baechle,
	Richard Henderson, linux-arch, linux-kernel

On Wed, May 27, 2020 at 03:46:08PM +0200, Arnd Bergmann wrote:
> drivers/hwmon/amd_energy.c:195:15: error: invalid operands to binary expression ('void' and 'int')
>                                         (channel - data->nr_cpus));
>                                         ~~~~~~~~~^~~~~~~~~~~~~~~~~
> include/asm-generic/topology.h:51:42: note: expanded from macro 'cpumask_of_node'
>     #define cpumask_of_node(node)       ((void)node, cpu_online_mask)
>                                                ^~~~
> include/linux/cpumask.h:618:72: note: expanded from macro 'cpumask_first_and'
>  #define cpumask_first_and(src1p, src2p) cpumask_next_and(-1, (src1p), (src2p))
>                                                                        ^~~~~
> 
> Fixes: f0b848ce6fe9 ("cpumask: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask")
> Fixes: 8abee9566b7e ("hwmon: Add amd_energy driver to report energy counters")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Didn't I Cc: you on the same patch I sent out earlier ? Never mind, though.

Acked-by: Guenter Roeck <linux@roeck-us.net>

Guenter

> ---
>  include/asm-generic/topology.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
> index 238873739550..5aa8705df87e 100644
> --- a/include/asm-generic/topology.h
> +++ b/include/asm-generic/topology.h
> @@ -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
> -- 
> 2.26.2
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-27 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 13:46 [PATCH] cpumask: guard cpumask_of_node() macro argument Arnd Bergmann
2020-05-27 14:51 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.