Skip to content

Commit

Permalink
rcutorture: Abstract TOROUT_STRING() and friends
Browse files Browse the repository at this point in the history
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@linux.vnet.ibm.com>
  • Loading branch information
paulmck committed Feb 23, 2014
1 parent 5ccf60f commit c2884de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions include/linux/torture.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions kernel/rcu/rcutorture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c2884de

Please sign in to comment.