From: Zbigniew Jędrzejewski-Szmek Date: Thu, 30 May 2019 20:49:00 +0000 (+0200) Subject: basic/memory-util: do not "return" anything from memzero() macro X-Git-Tag: v243-rc1~335^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3135369cffd78e31b795697ba3167e282f429a19;p=thirdparty%2Fsystemd.git basic/memory-util: do not "return" anything from memzero() macro The macro is not used in expressions, so we don't need the ternary statement. --- diff --git a/src/basic/memory-util.h b/src/basic/memory-util.h index 915c24a5dde..0e8957b7838 100644 --- a/src/basic/memory-util.h +++ b/src/basic/memory-util.h @@ -37,8 +37,8 @@ static inline int memcmp_nn(const void *s1, size_t n1, const void *s2, size_t n2 #define memzero(x,l) \ ({ \ size_t _l_ = (l); \ - void *_x_ = (x); \ - _l_ == 0 ? _x_ : memset(_x_, 0, _l_); \ + if (_l_ > 0) \ + memset(x, 0, _l_); \ }) #define zero(x) (memzero(&(x), sizeof(x)))