Re: [PATCH net-next v9 2/6] net: change netdev_hw_addr_list count through helpers
From: Nicolas Dichtel
Date: Wed Sep 30 2026 - 09:36:49 EST
Le 30/09/2026 à 13:28, Yuyang Huang a écrit :
> The count of a netdev_hw_addr_list is changed in several places of
> dev_addr_lists.c and a few drivers read it directly. The next patch
> needs to account every change of the count of dev->mc.
>
> Add __hw_addr_count_add(), __hw_addr_count_inc(), __hw_addr_count_dec()
> and __hw_addr_count_reset(), use them for every change of the count
> and rename the field to _count so that a direct write stands out.
> Readers keep using netdev_hw_addr_list_count() and the netdev_uc_count()
> and netdev_mc_count() helpers, the few that read the field directly
> are converted. No functional change.
>
> Signed-off-by: Yuyang Huang <sigefriedhyy@xxxxxxxxx>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx>
If you respin a version, you can use netdev_hw_addr_list_count() in
__hw_addr_list_snapshot() also.
Thanks,
Nicolas