diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-07-03 11:24:18 +0800 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2013-08-19 12:34:18 -0500 |
commit | a62cd29c985cf87b55a76f47582609119bd4b7a1 (patch) | |
tree | 0d21e1bec674bc3f2df139d0c51b40a219d92350 /drivers/net/npe/include | |
parent | 25634210af785e36cf73a5e9a103c8cac5d84a26 (diff) |
net: Use ARRAY_SIZE at appropriate places
Use ARRAY_SIZE instead of having similar implementation in each drivers.
The NUMELEMS defined in drivers/net/npe/include/IxOsalTypes.h is not used
at all, so this patch removes it instead of converting it to use ARRAY_SIZE.
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>
Diffstat (limited to 'drivers/net/npe/include')
-rw-r--r-- | drivers/net/npe/include/IxEthDBPortDefs.h | 2 | ||||
-rw-r--r-- | drivers/net/npe/include/IxOsalTypes.h | 6 |
2 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/npe/include/IxEthDBPortDefs.h b/drivers/net/npe/include/IxEthDBPortDefs.h index c3acbdddef..eac48cbb38 100644 --- a/drivers/net/npe/include/IxEthDBPortDefs.h +++ b/drivers/net/npe/include/IxEthDBPortDefs.h @@ -106,7 +106,7 @@ static const IxEthDBPortDefinition ixEthDBPortDefinitions[] = * @def IX_ETH_DB_NUMBER_OF_PORTS * @brief number of supported ports */ -#define IX_ETH_DB_NUMBER_OF_PORTS (sizeof (ixEthDBPortDefinitions) / sizeof (ixEthDBPortDefinitions[0])) +#define IX_ETH_DB_NUMBER_OF_PORTS ARRAY_SIZE(ixEthDBPortDefinitions) /** * @def IX_ETH_DB_UNKNOWN_PORT diff --git a/drivers/net/npe/include/IxOsalTypes.h b/drivers/net/npe/include/IxOsalTypes.h index 06e71debfb..00a49ada05 100644 --- a/drivers/net/npe/include/IxOsalTypes.h +++ b/drivers/net/npe/include/IxOsalTypes.h @@ -91,12 +91,6 @@ typedef volatile UINT32 VUINT32; */ typedef volatile INT32 VINT32; - -#ifndef NUMELEMS -#define NUMELEMS(x) (sizeof(x) / sizeof((x)[0])) -#endif - - /** * @ingroup IxOsalTypes * |