]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xen: make CONFIG_DEBUG_LOCKS usable without CONFIG_DEBUG
authorJuergen Gross <jgross@suse.com>
Tue, 21 Jan 2020 10:13:01 +0000 (11:13 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 24 Jan 2020 15:16:23 +0000 (15:16 +0000)
In expert mode it is possible to enable CONFIG_DEBUG_LOCKS without
having enabled CONFIG_DEBUG. The coding is depending on CONFIG_DEBUG
as it is using ASSERT(), however.

Fix that by using BUG_ON() instead of ASSERT() in rel_lock().

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/spinlock.c

index 286f916bca598a73038862ece56789a50a016823..344981c54a9dd890929214d2ac307605150edb9a 100644 (file)
@@ -86,7 +86,7 @@ static void got_lock(union lock_debug *debug)
 static void rel_lock(union lock_debug *debug)
 {
     if ( atomic_read(&spin_debug) > 0 )
-        ASSERT(debug->cpu == smp_processor_id());
+        BUG_ON(debug->cpu != smp_processor_id());
     debug->cpu = SPINLOCK_NO_CPU;
 }