[coreboot] New patch to review for coreboot: fd912e8 Supermicro H8QGI: Drop REQUIRED_CALLOUTS define
Aladyshev Konstantin (kostr@list.ru)
gerrit at coreboot.org
Tue Dec 18 22:07:58 CET 2012
Aladyshev Konstantin (kostr at list.ru) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2049
-gerrit
commit fd912e84efeb731bd09f5ec221c06e77aa22aa1c
Author: Kostr <aladyshev at nicevt.ru>
Date: Wed Dec 19 00:58:35 2012 +0400
Supermicro H8QGI: Drop REQUIRED_CALLOUTS define
There are 11 callouts in BiosCallouts[] struct but REQUIRED_CALLOUTS defined as 12.
To prevent such mistakes in future replace REQUIRED_CALLOUTS define with
dynamic variable CallOutCount:
CallOutCount = sizeof (BiosCallouts) / sizeof (BiosCallouts [0]);
REQUIRED_CALLOUTS was used only in BiosCallOuts.c file
Change-Id: Ia09795579a1170fa20ab94a30feb1af6821153d2
Signed-off-by: Kostr <aladyshev at nicevt.ru>
---
src/mainboard/supermicro/h8qgi/BiosCallOuts.c | 7 ++++---
src/mainboard/supermicro/h8qgi/BiosCallOuts.h | 1 -
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/mainboard/supermicro/h8qgi/BiosCallOuts.c b/src/mainboard/supermicro/h8qgi/BiosCallOuts.c
index b7f0124..7c9c7bd 100644
--- a/src/mainboard/supermicro/h8qgi/BiosCallOuts.c
+++ b/src/mainboard/supermicro/h8qgi/BiosCallOuts.c
@@ -24,7 +24,7 @@
#include "OptionsIds.h"
#include "heapManager.h"
-STATIC BIOS_CALLOUT_STRUCT BiosCallouts[REQUIRED_CALLOUTS] =
+STATIC BIOS_CALLOUT_STRUCT BiosCallouts[] =
{
{
AGESA_ALLOCATE_BUFFER,
@@ -87,14 +87,15 @@ AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
{
UINTN i;
AGESA_STATUS CalloutStatus;
+ UINTN CallOutCount = sizeof (BiosCallouts) / sizeof (BiosCallouts [0]);
- for (i = 0; i < REQUIRED_CALLOUTS; i++) {
+ for (i = 0; i < CallOutCount; i++) {
if (BiosCallouts[i].CalloutName == Func) {
break;
}
}
- if(i >= REQUIRED_CALLOUTS) {
+ if(i >= CallOutCount) {
return AGESA_UNSUPPORTED;
}
diff --git a/src/mainboard/supermicro/h8qgi/BiosCallOuts.h b/src/mainboard/supermicro/h8qgi/BiosCallOuts.h
index 24a05fb..88eddc5 100644
--- a/src/mainboard/supermicro/h8qgi/BiosCallOuts.h
+++ b/src/mainboard/supermicro/h8qgi/BiosCallOuts.h
@@ -23,7 +23,6 @@
#include "Porting.h"
#include "AGESA.h"
-#define REQUIRED_CALLOUTS 12
#define BIOS_HEAP_START_ADDRESS 0x00010000
#define BIOS_HEAP_SIZE 0x20000 /* 64MB */
More information about the coreboot
mailing list