mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 06:30:30 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user