summaryrefslogtreecommitdiff
path: root/src/vendorcode
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2022-01-21 17:06:20 -0800
committerJulius Werner <jwerner@chromium.org>2022-02-07 23:29:09 +0000
commite9665959edeba6ae2d5364c4f7339704b6b6fd42 (patch)
treee3cd9e0e6e91c9b6bd5c6f586a9abee1d654b5dd /src/vendorcode
parent266041f0e62296737617cc2fcfa97f31e2b43aea (diff)
treewide: Remove "ERROR: "/"WARN: " prefixes from log messages
Now that the console system itself will clearly differentiate loglevels, it is no longer necessary to explicitly add "ERROR: " in front of every BIOS_ERR message to help it stand out more (and allow automated tooling to grep for it). Removing all these extra .rodata characters should save us a nice little amount of binary size. This patch was created by running find src/ -type f -exec perl -0777 -pi -e 's/printk\(\s*BIOS_ERR,\s*"ERROR: /printk\(BIOS_ERR, "/gi' '{}' ';' and doing some cursory review/cleanup on the result. Then doing the same thing for BIOS_WARN with 's/printk\(\s*BIOS_WARNING,\s*"WARN(ING)?: /printk\(BIOS_WARNING, "/gi' Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I3d0573acb23d2df53db6813cb1a5fc31b5357db8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61309 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Lance Zhao Reviewed-by: Jason Glenesk <jason.glenesk@gmail.com>
Diffstat (limited to 'src/vendorcode')
-rw-r--r--src/vendorcode/eltan/security/verified_boot/vboot_check.c8
-rw-r--r--src/vendorcode/google/chromeos/cr50_enable_update.c12
-rw-r--r--src/vendorcode/google/chromeos/sar.c24
3 files changed, 20 insertions, 24 deletions
diff --git a/src/vendorcode/eltan/security/verified_boot/vboot_check.c b/src/vendorcode/eltan/security/verified_boot/vboot_check.c
index ed20af5076..09da5c50ad 100644
--- a/src/vendorcode/eltan/security/verified_boot/vboot_check.c
+++ b/src/vendorcode/eltan/security/verified_boot/vboot_check.c
@@ -36,13 +36,13 @@ int verified_boot_check_manifest(void)
buffer = cbfs_map(RSA_PUBLICKEY_FILE_NAME, &size);
if (!buffer || !size) {
- printk(BIOS_ERR, "ERROR: Public key not found!\n");
+ printk(BIOS_ERR, "Public key not found!\n");
goto fail;
}
if ((size != CONFIG_VENDORCODE_ELTAN_VBOOT_KEY_SIZE) ||
(buffer != (void *)CONFIG_VENDORCODE_ELTAN_VBOOT_KEY_LOCATION)) {
- printk(BIOS_ERR, "ERROR: Illegal public key!\n");
+ printk(BIOS_ERR, "Illegal public key!\n");
goto fail;
}
@@ -53,7 +53,7 @@ int verified_boot_check_manifest(void)
if ((sd->workbuf_used + size + sizeof(struct vb2_kernel_preamble) +
((CONFIG_VENDORCODE_ELTAN_OEM_MANIFEST_ITEMS * DIGEST_SIZE) + (2048/8))) >
sizeof(wb_buffer)) {
- printk(BIOS_ERR, "ERROR: Work buffer too small\n");
+ printk(BIOS_ERR, "Work buffer too small\n");
goto fail;
}
@@ -74,7 +74,7 @@ int verified_boot_check_manifest(void)
/* Fill body_signature (vb2_structure). RSA2048 key is used */
cbfs_map("oemmanifest.bin", &size);
if (size != ((CONFIG_VENDORCODE_ELTAN_OEM_MANIFEST_ITEMS * DIGEST_SIZE) + (2048/8))) {
- printk(BIOS_ERR, "ERROR: Incorrect manifest size!\n");
+ printk(BIOS_ERR, "Incorrect manifest size!\n");
goto fail;
}
pre->body_signature.data_size = CONFIG_VENDORCODE_ELTAN_OEM_MANIFEST_ITEMS *
diff --git a/src/vendorcode/google/chromeos/cr50_enable_update.c b/src/vendorcode/google/chromeos/cr50_enable_update.c
index fa5556b343..0a24d0f71a 100644
--- a/src/vendorcode/google/chromeos/cr50_enable_update.c
+++ b/src/vendorcode/google/chromeos/cr50_enable_update.c
@@ -44,8 +44,7 @@ static int cr50_is_reset_needed(void)
return 1;
} else if (ret != TPM_SUCCESS) {
/* TPM command failed, continue booting. */
- printk(BIOS_ERR,
- "ERROR: Attempt to get CR50 TPM mode failed: %x\n", ret);
+ printk(BIOS_ERR, "Attempt to get CR50 TPM mode failed: %x\n", ret);
return 0;
}
@@ -85,8 +84,7 @@ static void enable_update(void *unused)
ret = tlcl_lib_init();
if (ret != VB2_SUCCESS) {
- printk(BIOS_ERR,
- "ERROR: tlcl_lib_init() failed for CR50 update: %x\n",
+ printk(BIOS_ERR, "tlcl_lib_init() failed for CR50 update: %x\n",
ret);
return;
}
@@ -98,8 +96,7 @@ static void enable_update(void *unused)
&num_restored_headers);
if (ret != TPM_SUCCESS) {
- printk(BIOS_ERR,
- "ERROR: Attempt to enable CR50 update failed: %x\n",
+ printk(BIOS_ERR, "Attempt to enable CR50 update failed: %x\n",
ret);
return;
}
@@ -152,8 +149,7 @@ static void enable_update(void *unused)
* booting but the current boot will likely end up at
* the recovery screen.
*/
- printk(BIOS_ERR,
- "ERROR: Attempt to reset CR50 failed: %x\n",
+ printk(BIOS_ERR, "Attempt to reset CR50 failed: %x\n",
ret);
return;
}
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index 895958860b..130f5fad6a 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -25,7 +25,7 @@ static uint8_t *wifi_hextostr(const char *sar_str, size_t str_len, size_t *sar_b
if (!legacy_hex_format) {
sar_bin = malloc(str_len);
if (!sar_bin) {
- printk(BIOS_ERR, "ERROR: Failed to allocate space for SAR binary!\n");
+ printk(BIOS_ERR, "Failed to allocate space for SAR binary!\n");
return NULL;
}
@@ -35,12 +35,12 @@ static uint8_t *wifi_hextostr(const char *sar_str, size_t str_len, size_t *sar_b
bin_len = ((str_len - 1) / 2);
sar_bin = malloc(bin_len);
if (!sar_bin) {
- printk(BIOS_ERR, "ERROR: Failed to allocate space for SAR binary!\n");
+ printk(BIOS_ERR, "Failed to allocate space for SAR binary!\n");
return NULL;
}
if (hexstrtobin(sar_str, (uint8_t *)sar_bin, bin_len) != bin_len) {
- printk(BIOS_ERR, "ERROR: sar_limits contains non-hex value!\n");
+ printk(BIOS_ERR, "sar_limits contains non-hex value!\n");
free(sar_bin);
return NULL;
}
@@ -116,20 +116,20 @@ static int fill_wifi_sar_limits(union wifi_sar_limits *sar_limits, const uint8_t
size_t header_size = sar_header_size();
if (sar_bin_size < header_size) {
- printk(BIOS_ERR, "ERROR: Invalid SAR format!\n");
+ printk(BIOS_ERR, "Invalid SAR format!\n");
return -1;
}
header = (struct sar_header *)sar_bin;
if (header->version != SAR_FILE_REVISION) {
- printk(BIOS_ERR, "ERROR: Invalid SAR file version: %d!\n", header->version);
+ printk(BIOS_ERR, "Invalid SAR file version: %d!\n", header->version);
return -1;
}
for (i = 0; i < MAX_PROFILE_COUNT; i++) {
if (header->offsets[i] > sar_bin_size) {
- printk(BIOS_ERR, "ERROR: Offset is outside the file size!\n");
+ printk(BIOS_ERR, "Offset is outside the file size!\n");
return -1;
}
@@ -145,7 +145,7 @@ static int fill_wifi_sar_limits(union wifi_sar_limits *sar_limits, const uint8_t
expected_sar_bin_size += dsm_table_size(sar_limits->dsm);
if (sar_bin_size != expected_sar_bin_size) {
- printk(BIOS_ERR, "ERROR: Invalid SAR size, expected: %ld, obtained: %ld\n",
+ printk(BIOS_ERR, "Invalid SAR size, expected: %ld, obtained: %ld\n",
expected_sar_bin_size, sar_bin_size);
return -1;
}
@@ -164,7 +164,7 @@ static int fill_wifi_sar_limits_legacy(union wifi_sar_limits *sar_limits,
new_sar_bin = malloc(size);
if (!new_sar_bin) {
- printk(BIOS_ERR, "ERROR: Failed to allocate space for SAR binary!\n");
+ printk(BIOS_ERR, "Failed to allocate space for SAR binary!\n");
return -1;
}
@@ -259,13 +259,13 @@ int get_wifi_sar_limits(union wifi_sar_limits *sar_limits)
filename = get_wifi_sar_cbfs_filename();
if (filename == NULL) {
- printk(BIOS_ERR, "ERROR: Filename missing for CBFS SAR file!\n");
+ printk(BIOS_ERR, "Filename missing for CBFS SAR file!\n");
return ret;
}
sar_str = cbfs_map(filename, &sar_str_len);
if (!sar_str) {
- printk(BIOS_ERR, "ERROR: Failed to get the %s file size!\n", filename);
+ printk(BIOS_ERR, "Failed to get the %s file size!\n", filename);
return ret;
}
@@ -274,13 +274,13 @@ int get_wifi_sar_limits(union wifi_sar_limits *sar_limits)
} else if (valid_legacy_length(sar_str_len)) {
legacy_hex_format = true;
} else {
- printk(BIOS_ERR, "ERROR: Invalid SAR format!\n");
+ printk(BIOS_ERR, "Invalid SAR format!\n");
goto error;
}
sar_bin = wifi_hextostr(sar_str, sar_str_len, &sar_bin_len, legacy_hex_format);
if (sar_bin == NULL) {
- printk(BIOS_ERR, "ERROR: Failed to parse SAR file %s\n", filename);
+ printk(BIOS_ERR, "Failed to parse SAR file %s\n", filename);
goto error;
}