summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/pcengines/apu1/mainboard.c9
-rw-r--r--src/mainboard/pcengines/apu2/mainboard.c9
2 files changed, 6 insertions, 12 deletions
diff --git a/src/mainboard/pcengines/apu1/mainboard.c b/src/mainboard/pcengines/apu1/mainboard.c
index 05c496dc57bf..187f8cff3cd7 100644
--- a/src/mainboard/pcengines/apu1/mainboard.c
+++ b/src/mainboard/pcengines/apu1/mainboard.c
@@ -168,14 +168,11 @@ static void config_addon_uart(void)
#if CONFIG(GENERATE_SMBIOS_TABLES)
static int mainboard_smbios_type16(DMI_INFO *agesa_dmi, int *handle, unsigned long *current)
{
- struct smbios_type16 *t;
- u32 max_capacity;
- int len;
+ const u32 max_capacity = get_spd_offset() ? 4 : 2; /* 4GB or 2GB variant */
- t = (struct smbios_type16 *)*current;
- len = sizeof(*t);
+ struct smbios_type16 *t = (struct smbios_type16 *)*current;
+ int len = sizeof(*t);
memset(t, 0, len);
- max_capacity = get_spd_offset() ? 4 : 2; /* 4GB or 2GB variant */
t->type = SMBIOS_PHYS_MEMORY_ARRAY;
t->handle = *handle;
diff --git a/src/mainboard/pcengines/apu2/mainboard.c b/src/mainboard/pcengines/apu2/mainboard.c
index bcf25362379c..2c3b861d38ae 100644
--- a/src/mainboard/pcengines/apu2/mainboard.c
+++ b/src/mainboard/pcengines/apu2/mainboard.c
@@ -150,14 +150,11 @@ static void config_gpio_mux(void)
static int mainboard_smbios_type16(DMI_INFO *agesa_dmi, int *handle,
unsigned long *current)
{
- struct smbios_type16 *t;
- u32 max_capacity;
- int len = 0;
+ const u32 max_capacity = get_spd_offset() ? 4 : 2; /* 4GB or 2GB variant */
- t = (struct smbios_type16 *)*current;
- len = sizeof(*t);
+ struct smbios_type16 *t = (struct smbios_type16 *)*current;
+ int len = sizeof(*t);
memset(t, 0, len);
- max_capacity = get_spd_offset() ? 4 : 2; /* 4GB or 2GB variant */
t->type = SMBIOS_PHYS_MEMORY_ARRAY;
t->handle = *handle;