]> xenbits.xensource.com Git - pvdrivers/win/xenvbd.git/commitdiff
xencrsh: use ASSERT() in ASSERT3U/3S/3P() rather than BUG_ON()
authorPaul Durrant <pdurrant@amazon.com>
Wed, 17 Jun 2020 08:13:42 +0000 (09:13 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Wed, 17 Jun 2020 19:07:43 +0000 (20:07 +0100)
ASSERT() then resolves to BUG_ON() followed by __analysis_assume(), which
avoids some spurious warnings during code analysis.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: Owen Smith <owen.smith@citrix.com>
src/xencrsh/assert.h

index 546be5b7daca2d7c4b9653bae76c6977f79aa6de..c746c890f541c7946a736b4f40e05de2cf0ee6db 100644 (file)
@@ -87,7 +87,7 @@ __BugCheck(
             if (!(_Lval _OP _Rval)) {               \
                 LogError("%s = %llu\n", #_X, _Lval);\
                 LogError("%s = %llu\n", #_Y, _Rval);\
-                BUG_ON(_X _OP _Y);                  \
+                ASSERT((_X) _OP (_Y));              \
             }                                       \
         } while (FALSE)
 
@@ -98,7 +98,7 @@ __BugCheck(
             if (!(_Lval _OP _Rval)) {               \
                 LogError("%s = %lld\n", #_X, _Lval);\
                 LogError("%s = %lld\n", #_Y, _Rval);\
-                BUG_ON(_X _OP _Y);                  \
+                ASSERT((_X) _OP (_Y));              \
             }                                       \
         } while (FALSE)
 
@@ -109,7 +109,7 @@ __BugCheck(
             if (!(_Lval _OP _Rval)) {               \
                 LogError("%s = %p\n", #_X, _Lval);  \
                 LogError("%s = %p\n", #_Y, _Rval);  \
-                BUG_ON(_X _OP _Y);                  \
+                ASSERT((_X) _OP (_Y));              \
             }                                       \
         } while (FALSE)