summaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/ebitmap.h
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2022-01-25 15:14:14 +0100
committerPaul Moore <paul@paul-moore.com>2022-01-26 15:13:58 -0500
commit9e2fe574c02bde46307255467a5e4291f65227fe (patch)
tree5a94795947835f92fe02bbcf9a93ee369c0ddbfc /security/selinux/ss/ebitmap.h
parentd3b1161f29cf479b86d4c3c6f200a8eb27254877 (diff)
downloadlinux-9e2fe574c02bde46307255467a5e4291f65227fe.tar.gz
linux-9e2fe574c02bde46307255467a5e4291f65227fe.tar.bz2
linux-9e2fe574c02bde46307255467a5e4291f65227fe.zip
selinux: enclose macro arguments in parenthesis
Enclose the macro arguments in parenthesis to avoid potential evaluation order issues. Note the xperm and ebitmap macros are still not side-effect safe due to double evaluation. Reported by clang-tidy [bugprone-macro-parentheses] Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/ss/ebitmap.h')
-rw-r--r--security/selinux/ss/ebitmap.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/security/selinux/ss/ebitmap.h b/security/selinux/ss/ebitmap.h
index 9eb2d0af2805..58eb822f11ee 100644
--- a/security/selinux/ss/ebitmap.h
+++ b/security/selinux/ss/ebitmap.h
@@ -118,9 +118,9 @@ static inline void ebitmap_node_clr_bit(struct ebitmap_node *n,
}
#define ebitmap_for_each_positive_bit(e, n, bit) \
- for (bit = ebitmap_start_positive(e, &n); \
- bit < ebitmap_length(e); \
- bit = ebitmap_next_positive(e, &n, bit)) \
+ for ((bit) = ebitmap_start_positive(e, &(n)); \
+ (bit) < ebitmap_length(e); \
+ (bit) = ebitmap_next_positive(e, &(n), bit)) \
int ebitmap_cmp(struct ebitmap *e1, struct ebitmap *e2);
int ebitmap_cpy(struct ebitmap *dst, struct ebitmap *src);