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>
This commit is contained in:
Jeremy Sowden
2022-04-04 13:04:14 +01:00
committed by Florian Westphal
parent c3e3486667
commit c70b921fc1

View File

@@ -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];
}