mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
net: airoha: ppe: Do not use magic numbers in airoha_ppe_foe_get_entry_locked()
Explicit the size of entries pointed by hwe pointer in airoha_ppe_foe_get_entry_locked routine Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://patch.msgid.link/20251017-an7583-eth-support-v3-12-f28319666667@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
committed by
Paolo Abeni
parent
9d5b5219f6
commit
63f283d36b
@@ -619,7 +619,8 @@ airoha_ppe_foe_get_entry_locked(struct airoha_ppe *ppe, u32 hash)
|
||||
REG_PPE_RAM_CTRL(ppe2)))
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < sizeof(struct airoha_foe_entry) / 4; i++)
|
||||
for (i = 0; i < sizeof(struct airoha_foe_entry) / sizeof(*hwe);
|
||||
i++)
|
||||
hwe[i] = airoha_fe_rr(eth,
|
||||
REG_PPE_RAM_ENTRY(ppe2, i));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user