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/IxEthDBFeatures.c | |
parent | 25634210af785e36cf73a5e9a103c8cac5d84a26 (diff) | |
download | u-boot-imx-a62cd29c985cf87b55a76f47582609119bd4b7a1.zip u-boot-imx-a62cd29c985cf87b55a76f47582609119bd4b7a1.tar.gz u-boot-imx-a62cd29c985cf87b55a76f47582609119bd4b7a1.tar.bz2 |
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/IxEthDBFeatures.c')
-rw-r--r-- | drivers/net/npe/IxEthDBFeatures.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/npe/IxEthDBFeatures.c b/drivers/net/npe/IxEthDBFeatures.c index c5b680a..ecabec5 100644 --- a/drivers/net/npe/IxEthDBFeatures.c +++ b/drivers/net/npe/IxEthDBFeatures.c @@ -144,7 +144,7 @@ void ixEthDBFeatureCapabilityScan(void) /* find the traffic class definition index compatible with the current NPE A functionality ID */ for (trafficClassDefinitionIndex = 0 ; - trafficClassDefinitionIndex < sizeof (ixEthDBTrafficClassDefinitions) / sizeof (ixEthDBTrafficClassDefinitions[0]); + trafficClassDefinitionIndex < ARRAY_SIZE(ixEthDBTrafficClassDefinitions); trafficClassDefinitionIndex++) { if (ixEthDBTrafficClassDefinitions[trafficClassDefinitionIndex][IX_ETH_DB_NPE_A_FUNCTIONALITY_ID_INDEX] == npeAImageId.functionalityId) @@ -155,7 +155,7 @@ void ixEthDBFeatureCapabilityScan(void) } /* select the default case if we went over the array boundary */ - if (trafficClassDefinitionIndex == sizeof (ixEthDBTrafficClassDefinitions) / sizeof (ixEthDBTrafficClassDefinitions[0])) + if (trafficClassDefinitionIndex == ARRAY_SIZE(ixEthDBTrafficClassDefinitions)) { trafficClassDefinitionIndex = 0; /* the first record is the default case */ } |