[coreboot-gerrit] New patch to review for coreboot: ae52cfd northbridge/amd/agesa/family12/dimmSpd.c: Use ARRAY_SIZE macro

Edward O'Callaghan (eocallaghan@alterapraxis.com) gerrit at coreboot.org
Mon Nov 24 13:28:27 CET 2014


Edward O'Callaghan (eocallaghan at alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7574

-gerrit

commit ae52cfda3bc63953d49ae0ea8d46293eead1cf30
Author: Edward O'Callaghan <eocallaghan at alterapraxis.com>
Date:   Mon Nov 24 23:27:42 2014 +1100

    northbridge/amd/agesa/family12/dimmSpd.c: Use ARRAY_SIZE macro
    
    Change-Id: Icf980088c196b152cc4e5e179f7b7e334b695ccc
    Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
---
 src/northbridge/amd/agesa/family12/dimmSpd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/northbridge/amd/agesa/family12/dimmSpd.c b/src/northbridge/amd/agesa/family12/dimmSpd.c
index 3ac4d7d..e8ef02a 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) &&



More information about the coreboot-gerrit mailing list