From: Jeremy Sowden Date: Mon, 4 Apr 2022 12:04:14 +0000 (+0100) Subject: netfilter: bitwise: replace hard-coded size with `sizeof` expression X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c70b921fc1e877243f0fb495d18bb884a776b273;p=linux.git 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 Signed-off-by: Florian Westphal --- diff --git a/net/netfilter/nft_bitwise.c b/net/netfilter/nft_bitwise.c index 38caa66632b4e..dc5759fac5b6b 100644 --- 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]; }