Skip to content

Commit 1d4e803

Browse files
cgzonespcmoore
authored andcommitted
selinux: avoid extra semicolon
Wrap macro into `do { } while (0)` to avoid Clang emitting warnings about extra semicolons. Similar to userspace commit SELinuxProject/selinux@9d85aa6 Signed-off-by: Christian Göttsche <cgzones@googlemail.com> [PM: whitespace/indenting tweaks] Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent 7592051 commit 1d4e803

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

security/selinux/ss/avtab.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ static inline int avtab_hash(const struct avtab_key *keyp, u32 mask)
4040

4141
u32 hash = 0;
4242

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)
5252

5353
mix(keyp->target_class);
5454
mix(keyp->target_type);

0 commit comments

Comments
 (0)