[U-Boot] [PATCH] net: Use ARRAY_SIZE at appropriate places
Marek Vasut
marex at denx.de
Sat Jun 29 21:37:49 CEST 2013
Dear Axel Lin,
> Use ARRAY_SIZE instead of having similar implementation in each drivers.
>
> Signed-off-by: Axel Lin <axel.lin at ingics.com>
> Cc: Albert Aribaud <albert.u.boot at aribaud.net>
> Cc: Ben Warren <biggerbadderben at gmail.com>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> Cc: Joe Hershberger <joe.hershberger at ni.com>
> Cc: Marek Vasut <marex at denx.de>
> Cc: Mike Frysinger <vapier at gentoo.org>
> Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
> Cc: TsiChungLiew <Tsi-Chung.Liew at freescale.com>
> Cc: Wolfgang Denk <wd at denx.de>
> Cc: York Sun <yorksun at freescale.com>
You can trim the CC a bit next time ;-)
> ---
> Hi,
> tools/checkpatch.pl shows
> total: 2 errors, 12 warnings, 0 checks, 89 lines checked
>
> The errors are:
> ERROR: code indent should use tabs where possible
>
> The warnings are something like below:
> WARNING: line over 80 characters
> WARNING: please, no spaces at the start of a line
> WARNING: Avoid CamelCase: <ixEthDBPortDefinitions>
>
> I don't fixup the checkpatch.pl issues because I feel having the patch
> as is seems cleaner.
No problem on my end, that's understandable.
> Regards,
> Axel
>
> drivers/net/ax88180.c | 2 +-
> drivers/net/fsl_mcdmafec.c | 2 +-
> drivers/net/lan91c96.c | 2 +-
> drivers/net/mcffec.c | 2 +-
> drivers/net/mcfmii.c | 2 +-
> drivers/net/ne2000.c | 2 +-
> drivers/net/npe/IxEthDBFeatures.c | 4 ++--
> drivers/net/npe/IxOsalIoMem.c | 3 +--
> drivers/net/npe/include/IxEthDBPortDefs.h | 2 +-
> drivers/net/npe/include/IxOsalTypes.h | 2 +-
> 10 files changed, 11 insertions(+), 12 deletions(-)
[...]
> * @def IX_ETH_DB_UNKNOWN_PORT
> diff --git a/drivers/net/npe/include/IxOsalTypes.h
> b/drivers/net/npe/include/IxOsalTypes.h index 06e71de..615c655 100644
> --- a/drivers/net/npe/include/IxOsalTypes.h
> +++ b/drivers/net/npe/include/IxOsalTypes.h
> @@ -93,7 +93,7 @@ typedef volatile INT32 VINT32;
>
>
> #ifndef NUMELEMS
> -#define NUMELEMS(x) (sizeof(x) / sizeof((x)[0]))
> +#define NUMELEMS(x) ARRAY_SIZE(x)
> #endif
Just kill this macro altogether please.
Best regards,
Marek Vasut
More information about the U-Boot
mailing list