Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1387737 > unrolled thread

[PATCH locking 4/4] locktorture: Simplify torture_runnable computation

Started by"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
First post2016-04-26 19:30 +0200
Last post2016-04-28 12:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH locking 4/4] locktorture: Simplify torture_runnable computation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-04-26 19:30 +0200
    [tip:locking/core] lcoking/locktorture: Simplify the  torture_runnable computation "tip-bot for Paul E. McKenney" <tipbot@zytor.com> - 2016-04-28 12:30 +0200

#1387737 — [PATCH locking 4/4] locktorture: Simplify torture_runnable computation

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2016-04-26 19:30 +0200
Subject[PATCH locking 4/4] locktorture: Simplify torture_runnable computation
Message-ID<rseY9-34w-1@gated-at.bofh.it>
This commit replaces a #ifdef with IS_ENABLED(), saving five lines.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/locking/locktorture.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index d066a50dc87e..f8c5af52a131 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -75,12 +75,7 @@ struct lock_stress_stats {
 	long n_lock_acquired;
 };
 
-#if defined(MODULE)
-#define LOCKTORTURE_RUNNABLE_INIT 1
-#else
-#define LOCKTORTURE_RUNNABLE_INIT 0
-#endif
-int torture_runnable = LOCKTORTURE_RUNNABLE_INIT;
+int torture_runnable = IS_ENABLED(MODULE);
 module_param(torture_runnable, int, 0444);
 MODULE_PARM_DESC(torture_runnable, "Start locktorture at module init");
 
-- 
2.5.2

[toc] | [next] | [standalone]


#1389983 — [tip:locking/core] lcoking/locktorture: Simplify the torture_runnable computation

From"tip-bot for Paul E. McKenney" <tipbot@zytor.com>
Date2016-04-28 12:30 +0200
Subject[tip:locking/core] lcoking/locktorture: Simplify the torture_runnable computation
Message-ID<rsRmP-1va-41@gated-at.bofh.it>
In reply to#1387737
Commit-ID:  5db4298133d99b3dfc60d6899ac9df169769c899
Gitweb:     http://git.kernel.org/tip/5db4298133d99b3dfc60d6899ac9df169769c899
Author:     Paul E. McKenney <paulmck@linux.vnet.ibm.com>
AuthorDate: Tue, 26 Apr 2016 10:22:08 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 28 Apr 2016 10:57:51 +0200

lcoking/locktorture: Simplify the torture_runnable computation

This commit replaces an #ifdef with IS_ENABLED(), saving five lines.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: corbet@lwn.net
Cc: dave@stgolabs.net
Cc: dhowells@redhat.com
Cc: linux-doc@vger.kernel.org
Cc: will.deacon@arm.com
Link: http://lkml.kernel.org/r/1461691328-5429-4-git-send-email-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/locking/locktorture.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index d066a50..f8c5af5 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -75,12 +75,7 @@ struct lock_stress_stats {
 	long n_lock_acquired;
 };
 
-#if defined(MODULE)
-#define LOCKTORTURE_RUNNABLE_INIT 1
-#else
-#define LOCKTORTURE_RUNNABLE_INIT 0
-#endif
-int torture_runnable = LOCKTORTURE_RUNNABLE_INIT;
+int torture_runnable = IS_ENABLED(MODULE);
 module_param(torture_runnable, int, 0444);
 MODULE_PARM_DESC(torture_runnable, "Start locktorture at module init");
 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web