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>
This commit is contained in:
Angel Pons 2021-09-07 14:02:41 +02:00 committed by Felix Held
parent 8b98f8bf07
commit 39e029768b
1 changed files with 4 additions and 10 deletions

View File

@ -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");
}
/* 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, "};\n");
emit_resources(fil, ptr);