aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-01-27 19:27:00 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-23 12:01:00 -0500
commit9e2502254132261e0ea8010692fd447b1cedf627 (patch)
tree58310c4c524d2f5f5370114ddf970f4562125518 /include
parentdaeda23de108fab1202b6843e5adb59de0a261f9 (diff)
rcutorture: Abstract torture_param()
Create a torture_param() macro and apply it to rcutorture in order to save a few lines of code. This same macro may be applied to other torture frameworks. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/torture.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/torture.h b/include/linux/torture.h
index 979e3e6b378a..5aae880b6b4e 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -35,13 +35,18 @@
35#include <linux/bug.h> 35#include <linux/bug.h>
36#include <linux/compiler.h> 36#include <linux/compiler.h>
37 37
38/* Definitions for a non-string torture-test module parameter. */
39#define torture_param(type, name, init, msg) \
40 static type name = init; \
41 module_param(name, type, 0444); \
42 MODULE_PARM_DESC(name, msg);
43
44/* Low-rider random number generator. */
38struct torture_random_state { 45struct torture_random_state {
39 unsigned long trs_state; 46 unsigned long trs_state;
40 long trs_count; 47 long trs_count;
41}; 48};
42
43#define DEFINE_TORTURE_RANDOM(name) struct torture_random_state name = { 0, 0 } 49#define DEFINE_TORTURE_RANDOM(name) struct torture_random_state name = { 0, 0 }
44
45unsigned long torture_random(struct torture_random_state *trsp); 50unsigned long torture_random(struct torture_random_state *trsp);
46 51
47#endif /* __LINUX_TORTURE_H */ 52#endif /* __LINUX_TORTURE_H */