summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-19 01:10:40 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-20 19:36:14 +0100
commitd3cfcae9db39b0cd01bd8c3db1dc57d6a04554a4 (patch)
treea55a7686866028cb472cbe14f68b56d8af60baea /src/shared
parent780dbeef9f9d2c9f416da50a07bf0aacf3cc66c7 (diff)
macro: add _unlikely_() to assert_return()
As the name indicates assert_return() is really just for assertions, i.e. where it's a programming error if the assertion does not hold. Hence it is safe to add _unlikely_() decorators for the expression to check.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/macro.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/macro.h b/src/shared/macro.h
index 37cdff1cb3..c22de91705 100644
--- a/src/shared/macro.h
+++ b/src/shared/macro.h
@@ -150,7 +150,7 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) {
#define assert_return(expr, r) \
do { \
- if (!(expr)) \
+ if (_unlikely_(!(expr))) \
return (r); \
} while (false)