[Intel-wired-lan] [PATCH] igb: use ARRAY_SIZE to replace calculating sizeof(a)/sizeof(a[0])

Brown, Aaron F aaron.f.brown at intel.com
Sat Jul 18 01:47:59 UTC 2015


> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Todd Fujinaka
> Sent: Tuesday, June 30, 2015 3:17 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH] igb: use ARRAY_SIZE to replace
> calculating sizeof(a)/sizeof(a[0])
> 
> Use the ARRAY_SIZE macro rather than calculating sizeof(a)/sizeof(a[0]).
> Also directly replace the code rather than using an unnecessary define.
> 
> Signed-off-by: Todd Fujinaka <todd.fujinaka at intel.com>
> Reported-by: Maninder Singh <maninder1.s at samsung.com>
> Reported-by: Joe Perches <joe at perches.com>
> ---
>  drivers/net/ethernet/intel/igb/e1000_phy.c |   16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)

This is throwing a checkpatch over 80 character warning:
-----------------------------------
WARNING: line over 80 characters
#79: FILE: drivers/net/ethernet/intel/igb/e1000_phy.c:1860:
+               if ((cur_agc_index >= ARRAY_SIZE(e1000_igp_2_cable_length_table)) ||
-----------------------------------
But I don't really see how to shorten it so...

Tested-by: Aaron Brown <aaron.f.brown at intel.com>


More information about the Intel-wired-lan mailing list