From 4177cd82a66f372c6ef07836a0334682cdee97bb Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 9 Feb 2014 16:50:10 +0000 Subject: [PATCH] scst_debug.h: Avoid that the sBUG() and sBUG_ON() definitions confuse the smatch static code checker git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5277 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst_debug.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scst/include/scst_debug.h b/scst/include/scst_debug.h index 22145e7bd..f8a7f28ac 100644 --- a/scst/include/scst_debug.h +++ b/scst/include/scst_debug.h @@ -72,6 +72,14 @@ #if !defined(INSIDE_KERNEL_TREE) #ifdef CONFIG_SCST_DEBUG +#ifdef __CHECKER__ +/* + * Avoid that the while (...) local_bh_enable() loop confuses the lock checking + * code in smatch. + */ +#define sBUG() BUG() +#define sBUG_ON(p) BUG_ON((p)) +#else #define sBUG() do { \ pr_crit("BUG at %s:%d\n", __FILE__, __LINE__); \ local_irq_enable(); \ @@ -90,6 +98,7 @@ BUG(); \ } \ } while (0) +#endif #else