Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <cgzones@googlemail.com>
[PM: whitespace/indenting tweaks]
Signed-off-by: Paul Moore <paul@paul-moore.com>

authored by

Christian Göttsche and committed by
Paul Moore
1d4e8036 75920515

+9 -9
+9 -9
security/selinux/ss/avtab.c
··· 40 40 41 41 u32 hash = 0; 42 42 43 - #define mix(input) { \ 44 - u32 v = input; \ 45 - v *= c1; \ 46 - v = (v << r1) | (v >> (32 - r1)); \ 47 - v *= c2; \ 48 - hash ^= v; \ 49 - hash = (hash << r2) | (hash >> (32 - r2)); \ 50 - hash = hash * m + n; \ 51 - } 43 + #define mix(input) do { \ 44 + u32 v = input; \ 45 + v *= c1; \ 46 + v = (v << r1) | (v >> (32 - r1)); \ 47 + v *= c2; \ 48 + hash ^= v; \ 49 + hash = (hash << r2) | (hash >> (32 - r2)); \ 50 + hash = hash * m + n; \ 51 + } while (0) 52 52 53 53 mix(keyp->target_class); 54 54 mix(keyp->target_type);