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>
This commit is contained in:
Julius Werner
2022-01-21 17:06:20 -08:00
parent 266041f0e6
commit e9665959ed
129 changed files with 306 additions and 330 deletions

View File

@ -35,7 +35,7 @@ static bool extract(struct region *region, struct fit_image_node *node)
size_t true_size = 0;
if (node->size == 0) {
printk(BIOS_ERR, "ERROR: The %s size is 0\n", node->name);
printk(BIOS_ERR, "The %s size is 0\n", node->name);
return true;
}
@ -50,7 +50,7 @@ static bool extract(struct region *region, struct fit_image_node *node)
comp_name = "Decompressing LZ4";
break;
default:
printk(BIOS_ERR, "ERROR: Unsupported compression\n");
printk(BIOS_ERR, "Unsupported compression\n");
return true;
}
@ -76,7 +76,7 @@ static bool extract(struct region *region, struct fit_image_node *node)
}
if (!true_size) {
printk(BIOS_ERR, "ERROR: %s decompression failed!\n",
printk(BIOS_ERR, "%s decompression failed!\n",
comp_name);
return true;
}
@ -176,13 +176,13 @@ void fit_payload(struct prog *payload, void *data)
struct fit_config_node *config = fit_load(data);
if (!config) {
printk(BIOS_ERR, "ERROR: Could not load FIT\n");
printk(BIOS_ERR, "Could not load FIT\n");
return;
}
dt = unpack_fdt(config->fdt);
if (!dt) {
printk(BIOS_ERR, "ERROR: Failed to unflatten the FDT.\n");
printk(BIOS_ERR, "Failed to unflatten the FDT.\n");
return;
}
@ -190,7 +190,7 @@ void fit_payload(struct prog *payload, void *data)
list_for_each(chain, config->overlays, list_node) {
struct device_tree *overlay = unpack_fdt(chain->overlay);
if (!overlay || dt_apply_overlay(dt, overlay)) {
printk(BIOS_ERR, "ERROR: Failed to apply overlay %s!\n",
printk(BIOS_ERR, "Failed to apply overlay %s!\n",
chain->overlay->name);
}
}
@ -213,7 +213,7 @@ void fit_payload(struct prog *payload, void *data)
/* Invoke arch specific payload placement and fixups */
if (!fit_payload_arch(payload, config, &kernel, &fdt, &initrd)) {
printk(BIOS_ERR, "ERROR: Failed to find free memory region\n");
printk(BIOS_ERR, "Failed to find free memory region\n");
bootmem_dump_ranges();
return;
}
@ -227,7 +227,7 @@ void fit_payload(struct prog *payload, void *data)
if (config->ramdisk &&
extract(&initrd, config->ramdisk)) {
printk(BIOS_ERR, "ERROR: Failed to extract initrd\n");
printk(BIOS_ERR, "Failed to extract initrd\n");
prog_set_entry(payload, NULL, NULL);
return;
}
@ -235,7 +235,7 @@ void fit_payload(struct prog *payload, void *data)
timestamp_add_now(TS_KERNEL_DECOMPRESSION);
if (extract(&kernel, config->kernel)) {
printk(BIOS_ERR, "ERROR: Failed to extract kernel\n");
printk(BIOS_ERR, "Failed to extract kernel\n");
prog_set_entry(payload, NULL, NULL);
return;
}