Skip to contentSkip to conversation

numa: Mark __node_set as __always_inline

PATCH Superseded Tom Rini 2 participants 3 messages Jul 25, 2013 Bitmap API

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 numa: Mark __node_set as __always_inline

It is posible for some compilers to decide that __node_set does not need to be made turned into an inline function. When the compiler does this on an __init function calling it on __initdata we get a section mismatch warning now.

Cc Jianpeng Ma <[email protected]>
Cc Rusty Russell <[email protected]>
Cc Lai Jiangshan <[email protected]>
Cc Yasuaki Ishimatsu <[email protected]>
Cc Wen Congyang <[email protected]>
Cc Jiang Liu <[email protected]>
Cc KOSAKI Motohiro <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Mel Gorman <[email protected]>
Cc David Rientjes <[email protected]>
Cc Yinghai Lu <[email protected]>
Cc Greg KH <[email protected]>
---
 include/linux/nodemask.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nodemask.h +1 -1
index 4e2cbfa..10d0fd9 100644
@@ -99,7 +99,7 @@ typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
 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)
+static __always_inline void __node_set(int node, volatile nodemask_t *dstp)
 {
 	set_bit(node, dstp->bits);
 }
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 28 lines · Tom Rini

It is posible for some compilers to decide that __node_set does not need to be made turned into an inline function. When the compiler does this on an __init function calling it on __initdata we get a section mismatch warning now.

Cc Jianpeng Ma <[email protected]>
Cc Rusty Russell <[email protected]>
Cc Lai Jiangshan <[email protected]>
Cc Yasuaki Ishimatsu <[email protected]>
Cc Wen Congyang <[email protected]>
Cc Jiang Liu <[email protected]>
Cc KOSAKI Motohiro <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Mel Gorman <[email protected]>
Cc David Rientjes <[email protected]>
Cc Yinghai Lu <[email protected]>
Cc Greg KH <[email protected]>
---
  include/linux/nodemask.h |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nodemask.h +0 -0
index 4e2cbfa..10d0fd9 100644

include/linux/nodemask.h typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t; · line 102

Quoted 5 lines
include/linux/nodemask.h +1 -1
@@ -99,7 +99,7 @@ typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
  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)
+static __always_inline void __node_set(int node, volatile nodemask_t *dstp)

The change looks ok. But, this code doesn't tell us why you changed. Please write down proper comments here.

Quoted 4 lines
include/linux/nodemask.h +0 -0
  {
  	set_bit(node, dstp->bits);
  }
author
#2 lore raw
Quoted 31 lines · KOSAKI Motohiro
Quoted 30 lines · Tom Rini

It is posible for some compilers to decide that __node_set does not need to be made turned into an inline function. When the compiler does this on an __init function calling it on __initdata we get a section mismatch warning now.

Cc Jianpeng Ma <[email protected]>
Cc Rusty Russell <[email protected]>
Cc Lai Jiangshan <[email protected]>
Cc Yasuaki Ishimatsu <[email protected]>
Cc Wen Congyang <[email protected]>
Cc Jiang Liu <[email protected]>
Cc KOSAKI Motohiro <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Mel Gorman <[email protected]>
Cc David Rientjes <[email protected]>
Cc Yinghai Lu <[email protected]>
Cc Greg KH <[email protected]>
---
  include/linux/nodemask.h |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nodemask.h +0 -0
index 4e2cbfa..10d0fd9 100644
@@ -99,7 +99,7 @@ typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
  extern nodemask_t _unused_nodemask_arg_;
 
Quoted 6 lines

include/linux/nodemask.h typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t; · line 102

Quoted 3 lines
include/linux/nodemask.h +1 -1
  #define node_set(node, dst) __node_set((node), &(dst))
-static inline void __node_set(int node, volatile nodemask_t *dstp)
+static __always_inline void __node_set(int node, volatile nodemask_t *dstp)

The change looks ok. But, this code doesn't tell us why you changed. Please write down proper comments here.

Done, v2 submitted.

Signature · 1 line
Tom