summaryrefslogtreecommitdiffstats
path: root/include/linux/torture.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-01-27 16:27:00 -0800
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-23 09:01:00 -0800
commit9e2502254132261e0ea8010692fd447b1cedf627 (patch)
tree58310c4c524d2f5f5370114ddf970f4562125518 /include/linux/torture.h
parentdaeda23de108fab1202b6843e5adb59de0a261f9 (diff)
downloadop-kernel-dev-9e2502254132261e0ea8010692fd447b1cedf627.zip
op-kernel-dev-9e2502254132261e0ea8010692fd447b1cedf627.tar.gz
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/linux/torture.h')
-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 979e3e6..5aae880 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -35,13 +35,18 @@
#include <linux/bug.h>
#include <linux/compiler.h>
+/* Definitions for a non-string torture-test module parameter. */
+#define torture_param(type, name, init, msg) \
+ static type name = init; \
+ module_param(name, type, 0444); \
+ MODULE_PARM_DESC(name, msg);
+
+/* Low-rider random number generator. */
struct torture_random_state {
unsigned long trs_state;
long trs_count;
};
-
#define DEFINE_TORTURE_RANDOM(name) struct torture_random_state name = { 0, 0 }
-
unsigned long torture_random(struct torture_random_state *trsp);
#endif /* __LINUX_TORTURE_H */
OpenPOWER on IntegriCloud