From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 29 Jun 2013 21:37:49 +0200 Subject: [U-Boot] [PATCH] net: Use ARRAY_SIZE at appropriate places In-Reply-To: <1372511799.4542.2.camel@phoenix> References: <1372511799.4542.2.camel@phoenix> Message-ID: <201306292137.50005.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Axel Lin, > Use ARRAY_SIZE instead of having similar implementation in each drivers. > > Signed-off-by: Axel Lin > Cc: Albert Aribaud > Cc: Ben Warren > Cc: Jean-Christophe PLAGNIOL-VILLARD > Cc: Joe Hershberger > Cc: Marek Vasut > Cc: Mike Frysinger > Cc: Nobuhiro Iwamatsu > Cc: TsiChungLiew > Cc: Wolfgang Denk > Cc: York Sun 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: > > 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