[PATCH] xen/nodemask: Remove _unused_nodemask_arg_

Andrew Cooper posted 1 patch 3 weeks, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20260112104015.1001907-1-andrew.cooper3@citrix.com
xen/include/xen/nodemask.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[PATCH] xen/nodemask: Remove _unused_nodemask_arg_
Posted by Andrew Cooper 3 weeks, 4 days ago
This only exists to have it's type taken, despite there being a perfectly good
concrete type to use.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/include/xen/nodemask.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h
index 1dd6c7458e77..c9b18c47aace 100644
--- a/xen/include/xen/nodemask.h
+++ b/xen/include/xen/nodemask.h
@@ -67,8 +67,6 @@ typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
 
 #define nodemask_bits(src) ((src)->bits)
 
-extern nodemask_t _unused_nodemask_arg_;
-
 #define node_set(node, dst) __node_set((node), &(dst))
 static inline void __node_set(int node, volatile nodemask_t *dstp)
 {
@@ -215,7 +213,7 @@ static inline int __last_node(const nodemask_t *srcp, int nbits)
 
 #define nodemask_of_node(node)						\
 ({									\
-	typeof(_unused_nodemask_arg_) m;				\
+	nodemask_t m;							\
 	if (sizeof(m) == sizeof(unsigned long)) {			\
 		m.bits[0] = 1UL<<(node);				\
 	} else {							\
-- 
2.39.5


Re: [PATCH] xen/nodemask: Remove _unused_nodemask_arg_
Posted by Jan Beulich 3 weeks, 4 days ago
On 12.01.2026 11:40, Andrew Cooper wrote:
> This only exists to have it's type taken, despite there being a perfectly good
> concrete type to use.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

> --- a/xen/include/xen/nodemask.h
> +++ b/xen/include/xen/nodemask.h
> @@ -67,8 +67,6 @@ typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
>  
>  #define nodemask_bits(src) ((src)->bits)
>  
> -extern nodemask_t _unused_nodemask_arg_;
> -
>  #define node_set(node, dst) __node_set((node), &(dst))
>  static inline void __node_set(int node, volatile nodemask_t *dstp)
>  {
> @@ -215,7 +213,7 @@ static inline int __last_node(const nodemask_t *srcp, int nbits)
>  
>  #define nodemask_of_node(node)						\
>  ({									\
> -	typeof(_unused_nodemask_arg_) m;				\
> +	nodemask_t m;							\
>  	if (sizeof(m) == sizeof(unsigned long)) {			\
>  		m.bits[0] = 1UL<<(node);				\
>  	} else {							\

Hard to see why Linux would have introduced that either. (It still has it, btw.)

Jan
Re: [PATCH] xen/nodemask: Remove _unused_nodemask_arg_
Posted by Andrew Cooper 3 weeks, 4 days ago
On 12/01/2026 10:47 am, Jan Beulich wrote:
> On 12.01.2026 11:40, Andrew Cooper wrote:
>> This only exists to have it's type taken, despite there being a perfectly good
>> concrete type to use.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

>
>> --- a/xen/include/xen/nodemask.h
>> +++ b/xen/include/xen/nodemask.h
>> @@ -67,8 +67,6 @@ typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
>>  
>>  #define nodemask_bits(src) ((src)->bits)
>>  
>> -extern nodemask_t _unused_nodemask_arg_;
>> -
>>  #define node_set(node, dst) __node_set((node), &(dst))
>>  static inline void __node_set(int node, volatile nodemask_t *dstp)
>>  {
>> @@ -215,7 +213,7 @@ static inline int __last_node(const nodemask_t *srcp, int nbits)
>>  
>>  #define nodemask_of_node(node)						\
>>  ({									\
>> -	typeof(_unused_nodemask_arg_) m;				\
>> +	nodemask_t m;							\
>>  	if (sizeof(m) == sizeof(unsigned long)) {			\
>>  		m.bits[0] = 1UL<<(node);				\
>>  	} else {							\
> Hard to see why Linux would have introduced that either. (It still has it, btw.)

Yeah, it is a bizarre construct.  I only noticed it when trying to do
some more typeof cleanup.

~Andrew