]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/locking/locktorture.c
Merge tag 'audit-pr-20191126' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoor...
[linux.git] / kernel / locking / locktorture.c
index c513031cd7e3300fcc89a4340f673dd80cb59443..99475a66c94f82f6e44e5a5bd1574409198ace5e 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/kthread.h>
 #include <linux/sched/rt.h>
 #include <linux/spinlock.h>
-#include <linux/rwlock.h>
 #include <linux/mutex.h>
 #include <linux/rwsem.h>
 #include <linux/smp.h>
@@ -889,16 +888,16 @@ static int __init lock_torture_init(void)
                cxt.nrealwriters_stress = 2 * num_online_cpus();
 
 #ifdef CONFIG_DEBUG_MUTEXES
-       if (strncmp(torture_type, "mutex", 5) == 0)
+       if (str_has_prefix(torture_type, "mutex"))
                cxt.debug_lock = true;
 #endif
 #ifdef CONFIG_DEBUG_RT_MUTEXES
-       if (strncmp(torture_type, "rtmutex", 7) == 0)
+       if (str_has_prefix(torture_type, "rtmutex"))
                cxt.debug_lock = true;
 #endif
 #ifdef CONFIG_DEBUG_SPINLOCK
-       if ((strncmp(torture_type, "spin", 4) == 0) ||
-           (strncmp(torture_type, "rw_lock", 7) == 0))
+       if ((str_has_prefix(torture_type, "spin")) ||
+           (str_has_prefix(torture_type, "rw_lock")))
                cxt.debug_lock = true;
 #endif