From 0afc41e865fb4a3147c45e14483b4676f9019808 Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Tue, 27 Nov 2018 11:25:19 +0100 Subject: nb/amd/pi/00{630F01,730F01}: Use ARRAY_SIZE Use already defined ARRAY_SIZE macro. Change-Id: Ie22e3557e958b562816921a985411dd55c712142 Signed-off-by: Elyes HAOUAS Reviewed-on: https://review.coreboot.org/c/29860 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/northbridge/amd/pi/00630F01/dimmSpd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/northbridge/amd/pi/00630F01') diff --git a/src/northbridge/amd/pi/00630F01/dimmSpd.c b/src/northbridge/amd/pi/00630F01/dimmSpd.c index 28e3fe4bde..7e0200bef5 100644 --- a/src/northbridge/amd/pi/00630F01/dimmSpd.c +++ b/src/northbridge/amd/pi/00630F01/dimmSpd.c @@ -13,6 +13,7 @@ * GNU General Public License for more details. */ +#include #include #include @@ -23,8 +24,6 @@ #include -#define DIMENSION(array)(sizeof(array)/ sizeof(array [0])) - AGESA_STATUS AmdMemoryReadSPD (UINT32 unused1, UINTN unused2, AGESA_READ_SPD_PARAMS *info) { int spdAddress; @@ -34,11 +33,11 @@ AGESA_STATUS AmdMemoryReadSPD (UINT32 unused1, UINTN unused2, AGESA_READ_SPD_PAR if ((dev == 0) || (config == 0)) return AGESA_ERROR; - if (info->SocketId >= DIMENSION(config->spdAddrLookup )) + if (info->SocketId >= ARRAY_SIZE(config->spdAddrLookup)) return AGESA_ERROR; - if (info->MemChannelId >= DIMENSION(config->spdAddrLookup[0] )) + if (info->MemChannelId >= ARRAY_SIZE(config->spdAddrLookup[0])) return AGESA_ERROR; - if (info->DimmId >= DIMENSION(config->spdAddrLookup[0][0])) + if (info->DimmId >= ARRAY_SIZE(config->spdAddrLookup[0][0])) return AGESA_ERROR; spdAddress = config->spdAddrLookup -- cgit v1.2.3