summaryrefslogtreecommitdiffstats
path: root/util/sconfig
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-09-07 14:02:41 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-09-13 13:55:59 +0000
commit39e029768b90bbe4b3ccb05d6ffa9d4f5fa1050a (patch)
tree8bbe11ec701b723979f7854399c87ac57248bbc1 /util/sconfig
parent8b98f8bf076dbbd5bf5431ec41c06c3942880a24 (diff)
downloadcoreboot-39e029768b90bbe4b3ccb05d6ffa9d4f5fa1050a.tar.gz
coreboot-39e029768b90bbe4b3ccb05d6ffa9d4f5fa1050a.tar.bz2
coreboot-39e029768b90bbe4b3ccb05d6ffa9d4f5fa1050a.zip
util/sconfig: Always generate SMBIOS CPP guards
Manually maintaining a list of fields just to avoid printing some unnecessary CPP guards isn't worth the maintenance burden. Instead, always generate these guards, even if they guard nothing. Change-Id: I6c84180d83ac39a895e02d196acb7074eb052d7f Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/57459 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/sconfig')
-rw-r--r--util/sconfig/main.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index f7d1d1099f40..9d791ef6c330 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -1266,11 +1266,8 @@ static void pass1(FILE *fil, FILE *head, struct device *ptr, struct device *next
chip_ins->chip->name_underscore, chip_ins->id);
if (next)
fprintf(fil, "\t.next=&%s,\n", next->name);
- if (ptr->smbios_slot_type || ptr->smbios_slot_data_width ||
- ptr->smbios_slot_designation || ptr->smbios_slot_length) {
- fprintf(fil, "#if !DEVTREE_EARLY\n");
- fprintf(fil, "#if CONFIG(GENERATE_SMBIOS_TABLES)\n");
- }
+ fprintf(fil, "#if !DEVTREE_EARLY\n");
+ fprintf(fil, "#if CONFIG(GENERATE_SMBIOS_TABLES)\n");
/* SMBIOS types start at 1, if zero it hasn't been set */
if (ptr->smbios_slot_type)
fprintf(fil, "\t.smbios_slot_type = %s,\n",
@@ -1284,11 +1281,8 @@ static void pass1(FILE *fil, FILE *head, struct device *ptr, struct device *next
if (ptr->smbios_slot_length)
fprintf(fil, "\t.smbios_slot_length = %s,\n",
ptr->smbios_slot_length);
- if (ptr->smbios_slot_type || ptr->smbios_slot_data_width ||
- ptr->smbios_slot_designation || ptr->smbios_slot_length) {
- fprintf(fil, "#endif\n");
- fprintf(fil, "#endif\n");
- }
+ fprintf(fil, "#endif\n");
+ fprintf(fil, "#endif\n");
fprintf(fil, "};\n");
emit_resources(fil, ptr);