summaryrefslogtreecommitdiff
path: root/src/northbridge/amd
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-11-24 23:27:42 +1100
committerEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-11-25 12:21:46 +0100
commitf0c73ac341511427ae36d0e40293b5c0fc24abd4 (patch)
tree4e98ce6ac5b7a902fcdab3558463ad1b35a490e2 /src/northbridge/amd
parent95948934e7acc9fe1261669d01924ea839ea1f28 (diff)
northbridge/amd/agesa/family12/dimmSpd.c: Use ARRAY_SIZE macro
Change-Id: Icf980088c196b152cc4e5e179f7b7e334b695ccc Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/7574 Tested-by: build bot (Jenkins) Reviewed-by: Nicolas Reinecke <nr@das-labor.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/northbridge/amd')
-rw-r--r--src/northbridge/amd/agesa/family12/dimmSpd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/northbridge/amd/agesa/family12/dimmSpd.c b/src/northbridge/amd/agesa/family12/dimmSpd.c
index 3ac4d7d638..e8ef02a5b7 100644
--- a/src/northbridge/amd/agesa/family12/dimmSpd.c
+++ b/src/northbridge/amd/agesa/family12/dimmSpd.c
@@ -27,14 +27,13 @@
*
***************************************************************************/
+#include <stdlib.h>
#include "Porting.h"
#include "AGESA.h"
#include "amdlib.h"
#include <northbridge/amd/agesa/dimmSpd.h>
-#define DIMENSION(array)(sizeof (array)/ sizeof (array [0]))
-
typedef struct _DIMM_INFO_SMBUS{
UINT8 SocketId;
UINT8 MemChannelId;
@@ -60,7 +59,7 @@ AmdMemoryReadSPD (
{
UINT8 SmBusAddress = 0;
UINTN Index;
- UINTN MaxSocket = DIMENSION (SpdAddrLookup);
+ UINTN MaxSocket = ARRAY_SIZE(SpdAddrLookup);
for (Index = 0; Index < MaxSocket; Index ++){
if ((SpdData->SocketId == SpdAddrLookup[Index].SocketId) &&
(SpdData->MemChannelId == SpdAddrLookup[Index].MemChannelId) &&