diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2022-01-25 15:14:14 +0100 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2022-01-26 15:13:58 -0500 |
commit | 9e2fe574c02bde46307255467a5e4291f65227fe (patch) | |
tree | 5a94795947835f92fe02bbcf9a93ee369c0ddbfc /security/selinux/ss/ebitmap.h | |
parent | d3b1161f29cf479b86d4c3c6f200a8eb27254877 (diff) |
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.h | 6 |
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); |