projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3e3486
)
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
38caa66
..
dc5759f
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];
}