Skip to contentSkip to conversation

kernel/rcu/rcutorture.c: use macro to define module parameter

PATCH In review Pranith Kumar 2 participants 4 messages Apr 16, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 kernel/rcu/rcutorture.c: use macro to define module parameter

use the defined macro for module parameter definition

---
 kernel/rcu/rcutorture.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/rcu/rcutorture.c +2 -3
index bd30bc6..1a0298c 100644
@@ -143,9 +143,8 @@ static struct list_head rcu_torture_removed;
 #else
 #define RCUTORTURE_RUNNABLE_INIT 0
 #endif
-int rcutorture_runnable = RCUTORTURE_RUNNABLE_INIT;
-module_param(rcutorture_runnable, int, 0444);
-MODULE_PARM_DESC(rcutorture_runnable, "Start rcutorture at boot");
+torture_param(int, rcutorture_runnable, RCUTORTURE_RUNNABLE_INIT,
+		"Start rcutorture at boot");
 
 #if defined(CONFIG_RCU_BOOST) && !defined(CONFIG_HOTPLUG_CPU)
 #define rcu_can_boost() 1
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 3 lines · Pranith Kumar

use the defined macro for module parameter definition

This fails for me. The problem is that the defined macro makes everything static, and rcutorture_runnable is used in kernel/sysctl.c. :-/

In theory, it would be possible to make torture_param() take "static" as a parameter, but this adds more characters than it removes.

Thanx, Paul

Quoted 23 lines
---
 kernel/rcu/rcutorture.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/rcu/rcutorture.c +2 -3
index bd30bc6..1a0298c 100644
@@ -143,9 +143,8 @@ static struct list_head rcu_torture_removed;
 #else
 #define RCUTORTURE_RUNNABLE_INIT 0
 #endif
-int rcutorture_runnable = RCUTORTURE_RUNNABLE_INIT;
-module_param(rcutorture_runnable, int, 0444);
-MODULE_PARM_DESC(rcutorture_runnable, "Start rcutorture at boot");
+torture_param(int, rcutorture_runnable, RCUTORTURE_RUNNABLE_INIT,
+		"Start rcutorture at boot");
 
 #if defined(CONFIG_RCU_BOOST) && !defined(CONFIG_HOTPLUG_CPU)
 #define rcu_can_boost() 1
Signature · 1 line
1.7.9.5
#2 lore raw
Quoted 7 lines · Paul E. McKenney

This fails for me. The problem is that the defined macro makes everything static, and rcutorture_runnable is used in kernel/sysctl.c. :-/

In theory, it would be possible to make torture_param() take "static" as a parameter, but this adds more characters than it removes.

Oh, I just tried building it as a module and it worked. In the future I will run this both as inbuilt and as a module before sending any patches.

Sorry for the noise!

Signature · 1 line
Pranith
#3 lore raw
Quoted 10 lines · Pranith Kumar
Quoted 7 lines · Paul E. McKenney

This fails for me. The problem is that the defined macro makes everything static, and rcutorture_runnable is used in kernel/sysctl.c. :-/

In theory, it would be possible to make torture_param() take "static" as a parameter, but this adds more characters than it removes.

Quoted 5 lines

Oh, I just tried building it as a module and it worked. In the future I will run this both as inbuilt and as a module before sending any patches.

Sorry for the noise!

This is not noise! I do intend to use it as a module in the future, so it is helpful that you found and fixed the other bugs. I really cannot complain about one bad patch out of several useful fixes! So please do keep trying things and looking at things in RCU. ;-)

Thanx, Paul