From 39e029768b90bbe4b3ccb05d6ffa9d4f5fa1050a Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Tue, 7 Sep 2021 14:02:41 +0200 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/57459 Reviewed-by: Nico Huber Reviewed-by: Tim Wawrzynczak Tested-by: build bot (Jenkins) --- util/sconfig/main.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/util/sconfig/main.c b/util/sconfig/main.c index f7d1d1099f..9d791ef6c3 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);