[tip:core/rcu] rcutorture: Abstract TOROUT_STRING() and friends

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  c2884de38e01134ae040d55aa5644049d1bb850f
Gitweb:     http://git.kernel.org/tip/c2884de38e01134ae040d55aa5644049d1bb850f
Author:     Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
AuthorDate: Wed, 29 Jan 2014 07:30:50 -0800
Committer:  Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
CommitDate: Sun, 23 Feb 2014 09:01:02 -0800

rcutorture: Abstract TOROUT_STRING() and friends

These diagnostic macros are not confined to torturing RCU, so this commit
makes them available to other torture tests.  Also removed the do-while
from TOROUT_STRING() in response to checkpatch complaints.

Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
---
 include/linux/torture.h | 8 ++++++++
 kernel/rcu/rcutorture.c | 8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/linux/torture.h b/include/linux/torture.h
index 5aae880..09be888 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -41,6 +41,14 @@
 	module_param(name, type, 0444); \
 	MODULE_PARM_DESC(name, msg);
 
+#define TORTURE_FLAG "-torture:"
+#define TOROUT_STRING(s) \
+	pr_alert("%s" TORTURE_FLAG s "\n", torture_type)
+#define VERBOSE_TOROUT_STRING(s) \
+	do { if (verbose) pr_alert("%s" TORTURE_FLAG s "\n", torture_type); } while (0)
+#define VERBOSE_TOROUT_ERRSTRING(s) \
+	do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! " s "\n", torture_type); } while (0)
+
 /* Low-rider random number generator. */
 struct torture_random_state {
 	unsigned long trs_state;
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 34a75b1..86fd8c1 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -97,14 +97,6 @@ static char *torture_type = "rcu";
 module_param(torture_type, charp, 0444);
 MODULE_PARM_DESC(torture_type, "Type of RCU to torture (rcu, rcu_bh, ...)");
 
-#define TORTURE_FLAG "-torture:"
-#define TOROUT_STRING(s) \
-	do { pr_alert("%s" TORTURE_FLAG s "\n", torture_type); } while (0)
-#define VERBOSE_TOROUT_STRING(s) \
-	do { if (verbose) pr_alert("%s" TORTURE_FLAG s "\n", torture_type); } while (0)
-#define VERBOSE_TOROUT_ERRSTRING(s) \
-	do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! " s "\n", torture_type); } while (0)
-
 static int nrealreaders;
 static struct task_struct *writer_task;
 static struct task_struct **fakewriter_tasks;
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux