Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36632 )
Change subject: eltan/security: Remove some preprocessor guards ......................................................................
eltan/security: Remove some preprocessor guards
We generally let garbage-collection take care of unused functions. While at it, move some related variable declarations in to the header file and declare them const like they should be.
Change-Id: I7c6fa15bd45f861f13b6123ccb14c55415e42bc7 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/vendorcode/eltan/security/mboot/mboot.c M src/vendorcode/eltan/security/verified_boot/vboot_check.c M src/vendorcode/eltan/security/verified_boot/vboot_check.h 3 files changed, 6 insertions(+), 22 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/36632/1
diff --git a/src/vendorcode/eltan/security/mboot/mboot.c b/src/vendorcode/eltan/security/mboot/mboot.c index 4823c6a..228d1a0 100644 --- a/src/vendorcode/eltan/security/mboot/mboot.c +++ b/src/vendorcode/eltan/security/mboot/mboot.c @@ -266,7 +266,6 @@ return status; }
-#ifdef __PRE_RAM__ /* * Called from early romstage * @@ -473,4 +472,3 @@
return status; } -#endif // __PRE_RAM__ diff --git a/src/vendorcode/eltan/security/verified_boot/vboot_check.c b/src/vendorcode/eltan/security/verified_boot/vboot_check.c index 88519bd..0e96f52 100644 --- a/src/vendorcode/eltan/security/verified_boot/vboot_check.c +++ b/src/vendorcode/eltan/security/verified_boot/vboot_check.c @@ -276,13 +276,11 @@ i++; } } -#ifdef __BOOTBLOCK__ + /* * BOOTBLOCK */
-extern verify_item_t bootblock_verify_list[]; - void verified_boot_bootblock_check(void) { printk(BIOS_SPEW, "%s: processing bootblock items\n", __func__); @@ -301,9 +299,7 @@ printk(BIOS_SPEW, "%s: bootblock\n", __func__); verified_boot_bootblock_check(); } -#endif //__BOOTBLOCK__
-#ifdef __ROMSTAGE__ /* * ROMSTAGE */ @@ -340,23 +336,17 @@ prepare_romstage = 1; } } -#endif //__ROMSTAGE__
-#ifdef __POSTCAR__ /* * POSTCAR */
-extern verify_item_t postcar_verify_list[]; - static void vendor_secure_prepare(void) { printk(BIOS_SPEW, "%s: postcar\n", __func__); process_verify_list(postcar_verify_list); } -#endif //__POSTCAR__
-#ifdef __RAMSTAGE__ /* * RAM STAGE */ @@ -408,10 +398,6 @@ return 0; }
-extern verify_item_t payload_verify_list[]; - -extern verify_item_t oprom_verify_list[]; - int verified_boot_should_run_oprom(struct rom_header *rom_header) { return process_oprom_list(oprom_verify_list, rom_header); @@ -422,7 +408,6 @@ printk(BIOS_SPEW, "%s: ramstage\n", __func__); process_verify_list(payload_verify_list); } -#endif //__RAMSTAGE__
const struct cbfs_locator cbfs_master_header_locator = { .name = "Vendorcode Header Locator", diff --git a/src/vendorcode/eltan/security/verified_boot/vboot_check.h b/src/vendorcode/eltan/security/verified_boot/vboot_check.h index 22f1edf..36c8ffa 100644 --- a/src/vendorcode/eltan/security/verified_boot/vboot_check.h +++ b/src/vendorcode/eltan/security/verified_boot/vboot_check.h @@ -32,12 +32,8 @@ /* These method verifies the SHA256 hash over the 'named' CBFS component. * 'type' denotes the type of CBFS component i.e. stage, payload or fsp. */ -#ifdef __BOOTBLOCK__ void verified_boot_bootblock_check(void); -#endif -#ifdef __ROMSTAGE__ void verified_boot_early_check(void); -#endif
int verified_boot_check_manifest(void);
@@ -75,4 +71,9 @@
void process_verify_list(const verify_item_t list[]);
+extern const verify_item_t bootblock_verify_list[]; +extern const verify_item_t postcar_verify_list[]; +extern const verify_item_t payload_verify_list[]; +extern const verify_item_t oprom_verify_list[]; + #endif //VBOOT_CHECK_H