about summary refs log tree commit diff
path: root/shared/systemd/src/basic/macro.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2019-12-18 18:30:31 +0100
committerMichael Biebl <biebl@debian.org>2019-12-18 18:30:31 +0100
commit4bde769dba8f804547ce1f5fcda731035d3d45f1 (patch)
tree3a4907fdbf4972fad5a036ef64ce643d704e8733 /shared/systemd/src/basic/macro.h
parentbbf6329c27676323a899b7328575cc3f6c5f48cc (diff)
parent28028b26b3371756811e95d894f709f4b1207c00 (diff)
Update upstream source from tag 'upstream/1.22.0'
Update to upstream version '1.22.0'
with Debian dir a81ba1028908d08fc4866734c3df4a042bf9a511
Diffstat (limited to 'shared/systemd/src/basic/macro.h')
-rw-r--r--shared/systemd/src/basic/macro.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/shared/systemd/src/basic/macro.h b/shared/systemd/src/basic/macro.h
index 43c51326..fc733366 100644
--- a/shared/systemd/src/basic/macro.h
+++ b/shared/systemd/src/basic/macro.h
@@ -316,17 +316,18 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
 
 extern void __coverity_panic__(void);
 
-static inline int __coverity_check__(int condition) {
+static inline void __coverity_check__(int condition) {
+        if (!condition)
+                __coverity_panic__();
+}
+
+static inline int __coverity_check_and_return__(int condition) {
         return condition;
 }
 
-#define assert_message_se(expr, message)                                \
-        do {                                                            \
-                if (__coverity_check__(!(expr)))                        \
-                        __coverity_panic__();                           \
-        } while (false)
+#define assert_message_se(expr, message) __coverity_check__(!!(expr))
 
-#define assert_log(expr, message) __coverity_check__(!!(expr))
+#define assert_log(expr, message) __coverity_check_and_return__(!!(expr))
 
 #else  /* ! __COVERITY__ */