From: Christian Göttsche Date: Mon, 2 May 2022 14:10:51 +0000 (+0200) Subject: selinux: avoid extra semicolon X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1d4e8036cb2b301842797d447164464896824c58;p=linux.git selinux: avoid extra semicolon Wrap macro into `do { } while (0)` to avoid Clang emitting warnings about extra semicolons. Similar to userspace commit https://github.com/SELinuxProject/selinux/commit/9d85aa60d12e468e7fd510c2b5475b5299b71622 Signed-off-by: Christian Göttsche [PM: whitespace/indenting tweaks] Signed-off-by: Paul Moore --- diff --git a/security/selinux/ss/avtab.c b/security/selinux/ss/avtab.c index cfdae20792e11..ea9fc69568e3e 100644 --- a/security/selinux/ss/avtab.c +++ b/security/selinux/ss/avtab.c @@ -40,15 +40,15 @@ static inline int avtab_hash(const struct avtab_key *keyp, u32 mask) u32 hash = 0; -#define mix(input) { \ - u32 v = input; \ - v *= c1; \ - v = (v << r1) | (v >> (32 - r1)); \ - v *= c2; \ - hash ^= v; \ - hash = (hash << r2) | (hash >> (32 - r2)); \ - hash = hash * m + n; \ -} +#define mix(input) do { \ + u32 v = input; \ + v *= c1; \ + v = (v << r1) | (v >> (32 - r1)); \ + v *= c2; \ + hash ^= v; \ + hash = (hash << r2) | (hash >> (32 - r2)); \ + hash = hash * m + n; \ + } while (0) mix(keyp->target_class); mix(keyp->target_type);