]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selinux: avoid extra semicolon
authorChristian Göttsche <cgzones@googlemail.com>
Mon, 2 May 2022 14:10:51 +0000 (16:10 +0200)
committerPaul Moore <paul@paul-moore.com>
Tue, 3 May 2022 18:07:11 +0000 (14:07 -0400)
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 <cgzones@googlemail.com>
[PM: whitespace/indenting tweaks]
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/ss/avtab.c

index cfdae20792e116a83a4478bd6d12a79fcc27fd27..ea9fc69568e3e1fda7a9b0d5926afa03cec91c0c 100644 (file)
@@ -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);