Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: bitwise: replace hard-coded size with `sizeof` expression

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>

authored by

Jeremy Sowden and committed by
Florian Westphal
c70b921f c3e34866

+1 -1
+1 -1
net/netfilter/nft_bitwise.c
··· 30 30 { 31 31 unsigned int i; 32 32 33 - for (i = 0; i < DIV_ROUND_UP(priv->len, 4); i++) 33 + for (i = 0; i < DIV_ROUND_UP(priv->len, sizeof(u32)); i++) 34 34 dst[i] = (src[i] & priv->mask.data[i]) ^ priv->xor.data[i]; 35 35 } 36 36