mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 07:08:21 -04:00
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:
committed by
Florian Westphal
parent
c3e3486667
commit
c70b921fc1
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user