diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2017-10-16 11:05:03 -0700 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2017-12-11 09:18:22 -0800 |
commit | cc1321c96f855525fbd847fec130f000daa1bb1f (patch) | |
tree | cdfa9485981454a8de6d7b506970008051184386 /include/linux/torture.h | |
parent | cf8d8b00518d9228d603fcd17de47c31deb70b8f (diff) | |
download | linux-stable-cc1321c96f855525fbd847fec130f000daa1bb1f.tar.gz linux-stable-cc1321c96f855525fbd847fec130f000daa1bb1f.tar.bz2 linux-stable-cc1321c96f855525fbd847fec130f000daa1bb1f.zip |
torture: Reduce #ifdefs for preempt_schedule()
This commit adds a torture_preempt_schedule() that is nothingness
in !PREEMPT builds and is preempt_schedule() otherwise. Then
torture_preempt_schedule() is used to eliminate several ugly #ifdefs,
both in rcutorture and in locktorture.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'include/linux/torture.h')
-rw-r--r-- | include/linux/torture.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/torture.h b/include/linux/torture.h index a45702eb3e7b..907d266aaddc 100644 --- a/include/linux/torture.h +++ b/include/linux/torture.h @@ -96,4 +96,10 @@ void _torture_stop_kthread(char *m, struct task_struct **tp); #define torture_stop_kthread(n, tp) \ _torture_stop_kthread("Stopping " #n " task", &(tp)) +#ifdef CONFIG_PREEMPT +#define torture_preempt_schedule() preempt_schedule() +#else +#define torture_preempt_schedule() +#endif + #endif /* __LINUX_TORTURE_H */ |