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>
diff --git a/src/soc/intel/common/block/acpi/acpi_bert.c b/src/soc/intel/common/block/acpi/acpi_bert.c
index 85fbc03..beb131e 100644
--- a/src/soc/intel/common/block/acpi/acpi_bert.c
+++ b/src/soc/intel/common/block/acpi/acpi_bert.c
@@ -39,7 +39,7 @@
}
if (!cl_get_total_data_size()) {
- printk(BIOS_ERR, "Error: No crashlog record present\n");
+ printk(BIOS_ERR, "No crashlog record present\n");
return CB_ERR;
}
@@ -47,12 +47,12 @@
gesb_header_size = sizeof(*status);
if (!status) {
- printk(BIOS_ERR, "Error: unable to allocate GSB\n");
+ printk(BIOS_ERR, "unable to allocate GSB\n");
return CB_ERR;
}
if (cl_get_total_data_size() > bert_storage_remaining()) {
- printk(BIOS_ERR, "Error: Crashlog entry would exceed "
+ printk(BIOS_ERR, "Crashlog entry would exceed "
"available region\n");
return CB_ERR;
}
@@ -61,7 +61,7 @@
if (cpu_record_size) {
cl_data = new_cper_fw_error_crashlog(status, cpu_record_size);
if (!cl_data) {
- printk(BIOS_ERR, "Error: Crashlog CPU entry(size %lu) "
+ printk(BIOS_ERR, "Crashlog CPU entry(size %lu) "
"would exceed available region\n",
cpu_record_size);
return CB_ERR;
@@ -75,14 +75,14 @@
if (pmc_record_size) {
/* Allocate new FW ERR structure in case CPU crashlog is present */
if (cpu_record_size && !bert_append_fw_err(status)) {
- printk(BIOS_ERR, "Error: Crashlog PMC entry would "
+ printk(BIOS_ERR, "Crashlog PMC entry would "
"exceed available region\n");
return CB_ERR;
}
cl_data = new_cper_fw_error_crashlog(status, pmc_record_size);
if (!cl_data) {
- printk(BIOS_ERR, "Error: Crashlog PMC entry(size %lu) "
+ printk(BIOS_ERR, "Crashlog PMC entry(size %lu) "
"would exceed available region\n",
pmc_record_size);
return CB_ERR;
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c
index 6dfe329..a9a619c 100644
--- a/src/soc/intel/common/block/cse/cse.c
+++ b/src/soc/intel/common/block/cse/cse.c
@@ -1051,7 +1051,7 @@
* If the (CS)ME fails to change states after 3 attempts, it will
* likely need a cold boot, or recovering.
*/
- printk(BIOS_ERR, "Error: Failed to change ME state in %u attempts!\n",
+ printk(BIOS_ERR, "Failed to change ME state in %u attempts!\n",
ME_DISABLE_ATTEMPTS);
}
diff --git a/src/soc/intel/common/block/cse/cse_eop.c b/src/soc/intel/common/block/cse/cse_eop.c
index 3fc4e2b..5d6a4a7 100644
--- a/src/soc/intel/common/block/cse/cse_eop.c
+++ b/src/soc/intel/common/block/cse/cse_eop.c
@@ -172,7 +172,7 @@
break;
case CSE_EOP_RESULT_ERROR: /* fallthrough */
default:
- printk(BIOS_ERR, "ERROR: Failed to send EOP to CSE, %d\n", result);
+ printk(BIOS_ERR, "Failed to send EOP to CSE, %d\n", result);
/* For vboot, trigger recovery mode if applicable, as there is
likely something very broken in this case. */
if (CONFIG(VBOOT) && !vboot_recovery_mode_enabled())
diff --git a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
index 1b0652d..aead8de 100644
--- a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
+++ b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
@@ -350,7 +350,7 @@
}
if (fpr >= SPIBAR_FPR_MAX) {
- printk(BIOS_ERR, "ERROR: No SPI FPR free!\n");
+ printk(BIOS_ERR, "No SPI FPR free!\n");
return -1;
}
@@ -365,7 +365,7 @@
protect_mask |= (SPI_FPR_RPE | SPI_FPR_WPE);
break;
default:
- printk(BIOS_ERR, "ERROR: Seeking invalid protection!\n");
+ printk(BIOS_ERR, "Seeking invalid protection!\n");
return -1;
}
@@ -376,7 +376,7 @@
write32((void *)fpr_base, reg);
reg = read32((void *)fpr_base);
if (!(reg & protect_mask)) {
- printk(BIOS_ERR, "ERROR: Unable to set SPI FPR %d\n", fpr);
+ printk(BIOS_ERR, "Unable to set SPI FPR %d\n", fpr);
return -1;
}
diff --git a/src/soc/intel/common/block/irq/irq.c b/src/soc/intel/common/block/irq/irq.c
index 0074451..8b0642f 100644
--- a/src/soc/intel/common/block/irq/irq.c
+++ b/src/soc/intel/common/block/irq/irq.c
@@ -128,7 +128,7 @@
static bool assign_pirq(struct pin_info pin_info[PCI_INT_MAX], enum pci_pin pin, enum pirq pirq)
{
if (pirq < PIRQ_A || pirq > PIRQ_H) {
- printk(BIOS_ERR, "ERROR: Invalid pirq constraint %u\n", pirq);
+ printk(BIOS_ERR, "Invalid pirq constraint %u\n", pirq);
return false;
}
@@ -143,7 +143,7 @@
enum pci_pin fn_pin_map[MAX_FNS])
{
if (pin < PCI_INT_A || pin > PCI_INT_D) {
- printk(BIOS_ERR, "ERROR: Invalid pin constraint %u\n", pin);
+ printk(BIOS_ERR, "Invalid pin constraint %u\n", pin);
return false;
}
@@ -182,7 +182,7 @@
fixed pin */
const enum pci_pin pin = fn_pin_map[i];
if (pin == PCI_INT_NONE) {
- printk(BIOS_ERR, "ERROR: Slot %u, pirq %u, no pin for function %zu\n",
+ printk(BIOS_ERR, "Slot %u, pirq %u, no pin for function %zu\n",
constraints->slot, fixed_pirq, i);
return false;
}
@@ -210,7 +210,7 @@
const int irq = find_free_unique_irq();
if (irq == INVALID_IRQ) {
- printk(BIOS_ERR, "ERROR: No free unique IRQs found\n");
+ printk(BIOS_ERR, "No free unique IRQs found\n");
return false;
}
@@ -234,7 +234,7 @@
pin = find_shareable_pin(pin_info);
if (pin == PCI_INT_NONE) {
- printk(BIOS_ERR, "ERROR: No shareable pins found\n");
+ printk(BIOS_ERR, "No shareable pins found\n");
return false;
}
}
diff --git a/src/soc/intel/common/block/pcie/pcie_helpers.c b/src/soc/intel/common/block/pcie/pcie_helpers.c
index e8ed3be..00bef42 100644
--- a/src/soc/intel/common/block/pcie/pcie_helpers.c
+++ b/src/soc/intel/common/block/pcie/pcie_helpers.c
@@ -29,7 +29,7 @@
for (group = groups; group->count; ++group) {
if (group->count + offset >= sizeof(mask) * 8) {
- printk(BIOS_ERR, "ERROR: %s: Root port count greater than mask size!\n",
+ printk(BIOS_ERR, "%s: Root port count greater than mask size!\n",
__func__);
break;
}
diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c
index f7efeb7..da78d5c 100644
--- a/src/soc/intel/common/block/pmc/pmclib.c
+++ b/src/soc/intel/common/block/pmc/pmclib.c
@@ -611,7 +611,7 @@
pmc_soc_set_afterg3_en(target_on);
break;
default:
- printk(BIOS_WARNING, "WARNING: Unknown power-failure state: %d\n", state);
+ printk(BIOS_WARNING, "Unknown power-failure state: %d\n", state);
break;
}
}
diff --git a/src/soc/intel/common/block/thermal/thermal_pci.c b/src/soc/intel/common/block/thermal/thermal_pci.c
index 1b9f28a..04203fe 100644
--- a/src/soc/intel/common/block/thermal/thermal_pci.c
+++ b/src/soc/intel/common/block/thermal/thermal_pci.c
@@ -19,13 +19,13 @@
dev = pcidev_path_on_root(PCH_DEVFN_THERMAL);
if (!dev) {
- printk(BIOS_ERR, "ERROR: PCH_DEVFN_THERMAL device not found!\n");
+ printk(BIOS_ERR, "PCH_DEVFN_THERMAL device not found!\n");
return;
}
res = probe_resource(dev, PCI_BASE_ADDRESS_0);
if (!res) {
- printk(BIOS_ERR, "ERROR: PCH thermal device not found!\n");
+ printk(BIOS_ERR, "PCH thermal device not found!\n");
return;
}