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>
This commit is contained in:
parent
95948934e7
commit
f0c73ac341
|
@ -27,14 +27,13 @@
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include "Porting.h"
|
#include "Porting.h"
|
||||||
#include "AGESA.h"
|
#include "AGESA.h"
|
||||||
#include "amdlib.h"
|
#include "amdlib.h"
|
||||||
|
|
||||||
#include <northbridge/amd/agesa/dimmSpd.h>
|
#include <northbridge/amd/agesa/dimmSpd.h>
|
||||||
|
|
||||||
#define DIMENSION(array)(sizeof (array)/ sizeof (array [0]))
|
|
||||||
|
|
||||||
typedef struct _DIMM_INFO_SMBUS{
|
typedef struct _DIMM_INFO_SMBUS{
|
||||||
UINT8 SocketId;
|
UINT8 SocketId;
|
||||||
UINT8 MemChannelId;
|
UINT8 MemChannelId;
|
||||||
|
@ -60,7 +59,7 @@ AmdMemoryReadSPD (
|
||||||
{
|
{
|
||||||
UINT8 SmBusAddress = 0;
|
UINT8 SmBusAddress = 0;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINTN MaxSocket = DIMENSION (SpdAddrLookup);
|
UINTN MaxSocket = ARRAY_SIZE(SpdAddrLookup);
|
||||||
for (Index = 0; Index < MaxSocket; Index ++){
|
for (Index = 0; Index < MaxSocket; Index ++){
|
||||||
if ((SpdData->SocketId == SpdAddrLookup[Index].SocketId) &&
|
if ((SpdData->SocketId == SpdAddrLookup[Index].SocketId) &&
|
||||||
(SpdData->MemChannelId == SpdAddrLookup[Index].MemChannelId) &&
|
(SpdData->MemChannelId == SpdAddrLookup[Index].MemChannelId) &&
|
||||||
|
|
Loading…
Reference in New Issue