[PATCH 5/5] drivers/net: use RTE_DIM

Stephen Hemminger stephen at networkplumber.org
Tue Apr 16 19:32:34 CEST 2024


On Tue, 16 Apr 2024 17:29:25 +0100
Ferruh Yigit <ferruh.yigit at amd.com> wrote:

> On 4/16/2024 4:19 PM, Stephen Hemminger wrote:
> > Use RTE_DIM instead of computing directly with sizeof.
> > Patch automatically generated via cocci/rte_dim.cocci.
> > Code in base/ subdirectory manually excluded.
> > 
> > Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> >   
> 
> Updated ones looks good to me, but I can see a few more, I don't know if
> you excluded base file one intentionally,
> searched as `git grep "sizeof.*\[0\]" drivers/net/`
> 
> 
> -
> drivers/net/bnxt/tf_core/cfa_tcam_mgr.h:28:#define ARRAY_SIZE(_array)
> (sizeof(_array) / sizeof(_array[0]))
> 
> -

For the drivers that choose to define and use ARRAY_SIZE() that is fine.

Since base/ directories often come from other upstream repos, I ignored those.

Something about the Intel drivers was causing warnings and the script would
not automatically change those.



More information about the dev mailing list