projects
/
kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
627175a
)
netfilter: bitwise: replace hard-coded size with `sizeof` expression
author
Jeremy Sowden
<jeremy@azazel.net>
Mon, 4 Apr 2022 12:04:14 +0000
(13:04 +0100)
committer
Florian Westphal
<fw@strlen.de>
Sat, 9 Apr 2022 10:02:22 +0000
(12:02 +0200)
When calculating the length of an array, use the appropriate `sizeof`
expression for its type, rather than an integer literal.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nft_bitwise.c
patch
|
blob
|
history
diff --git
a/net/netfilter/nft_bitwise.c
b/net/netfilter/nft_bitwise.c
index 38caa66632b4e4cc331392f20d0ece18bb16e627..dc5759fac5b6b4034b98018f65c7b17a78345392 100644
(file)
--- a/
net/netfilter/nft_bitwise.c
+++ b/
net/netfilter/nft_bitwise.c
@@
-30,7
+30,7
@@
static void nft_bitwise_eval_bool(u32 *dst, const u32 *src,
{
unsigned int i;
- for (i = 0; i < DIV_ROUND_UP(priv->len,
4
); i++)
+ for (i = 0; i < DIV_ROUND_UP(priv->len,
sizeof(u32)
); i++)
dst[i] = (src[i] & priv->mask.data[i]) ^ priv->xor.data[i];
}