From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net: Use ARRAY_SIZE at appropriate places
Date: Sat, 29 Jun 2013 21:37:49 +0200 [thread overview]
Message-ID: <201306292137.50005.marex@denx.de> (raw)
In-Reply-To: <1372511799.4542.2.camel@phoenix>
Dear Axel Lin,
> Use ARRAY_SIZE instead of having similar implementation in each drivers.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
> Cc: Ben Warren <biggerbadderben@gmail.com>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Mike Frysinger <vapier@gentoo.org>
> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
> Cc: TsiChungLiew <Tsi-Chung.Liew@freescale.com>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: York Sun <yorksun@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
next prev parent reply other threads:[~2013-06-29 19:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-29 13:16 [U-Boot] [PATCH] net: Use ARRAY_SIZE at appropriate places Axel Lin
2013-06-29 19:17 ` Jagan Teki
2013-06-29 19:37 ` Marek Vasut [this message]
2013-06-30 1:33 ` Axel Lin
2013-06-30 3:40 ` Axel Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201306292137.50005.marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.