From a62cd29c985cf87b55a76f47582609119bd4b7a1 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 3 Jul 2013 11:24:18 +0800 Subject: 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 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 --- drivers/net/npe/IxOsalIoMem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/net/npe/IxOsalIoMem.c') diff --git a/drivers/net/npe/IxOsalIoMem.c b/drivers/net/npe/IxOsalIoMem.c index 34df92b..087fdf3 100644 --- a/drivers/net/npe/IxOsalIoMem.c +++ b/drivers/net/npe/IxOsalIoMem.c @@ -66,8 +66,7 @@ ixOsalMemMapFind (UINT32 requestedAddress, { UINT32 mapIndex; - UINT32 numMapElements = - sizeof (ixOsalGlobalMemoryMap) / sizeof (IxOsalMemoryMap); + UINT32 numMapElements = ARRAY_SIZE(ixOsalGlobalMemoryMap); for (mapIndex = 0; mapIndex < numMapElements; mapIndex++) { -- cgit v1.1