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

@@ -143,7 +143,7 @@ uint16_t ddr4_speed_mhz_to_reported_mts(uint16_t speed_mhz)
return speed_attr->reported_mts;
}
}
printk(BIOS_ERR, "ERROR: DDR4 speed of %d MHz is out of range\n", speed_mhz);
printk(BIOS_ERR, "DDR4 speed of %d MHz is out of range\n", speed_mhz);
return 0;
}

View File

@@ -94,6 +94,6 @@ uint16_t lpddr4_speed_mhz_to_reported_mts(uint16_t speed_mhz)
return speed_attr->reported_mts;
}
}
printk(BIOS_ERR, "ERROR: LPDDR4 speed of %d MHz is out of range\n", speed_mhz);
printk(BIOS_ERR, "LPDDR4 speed of %d MHz is out of range\n", speed_mhz);
return 0;
}

View File

@@ -233,7 +233,7 @@ static u8 vbe_get_ctrl_info(vbe_info_block *info)
0x0000, buffer_seg, buffer_adr);
/* If the VBE function completed successfully, 0x0 is returned in AH */
if (X86_AH) {
printk(BIOS_WARNING, "Warning: Error from VGA BIOS in %s\n", __func__);
printk(BIOS_WARNING, "Error from VGA BIOS in %s\n", __func__);
return 1;
}
memcpy(info, buffer, sizeof(vbe_info_block));

View File

@@ -497,7 +497,7 @@ static void pci_store_bridge_resource(const struct device *const dev,
} else {
/* Don't let me think I stored the resource. */
resource->flags &= ~IORESOURCE_STORED;
printk(BIOS_ERR, "ERROR: invalid resource->index %lx\n", resource->index);
printk(BIOS_ERR, "invalid resource->index %lx\n", resource->index);
}
}
@@ -510,7 +510,7 @@ static void pci_set_resource(struct device *dev, struct resource *resource)
we can treat it like an empty resource. */
resource->size = 0;
} else {
printk(BIOS_ERR, "ERROR: %s %02lx %s size: 0x%010llx not assigned\n",
printk(BIOS_ERR, "%s %02lx %s size: 0x%010llx not assigned\n",
dev_path(dev), resource->index,
resource_type(resource), resource->size);
return;
@@ -1617,8 +1617,7 @@ int get_pci_irq_pins(struct device *dev, struct device **parent_bdg)
/* Make sure the swizzle returned valid structures */
if (parent_bdg == NULL) {
printk(BIOS_WARNING,
"Warning: Could not find parent bridge for this device!\n");
printk(BIOS_WARNING, "Could not find parent bridge for this device!\n");
return -2;
}
} else { /* Device is not behind a bridge */

View File

@@ -126,12 +126,12 @@ static void pnp_set_resource(struct device *dev, struct resource *resource)
if (resource->flags & IORESOURCE_IRQ &&
(resource->index != PNP_IDX_IRQ0) &&
(resource->index != PNP_IDX_IRQ1))
printk(BIOS_WARNING, "WARNING: %s %02lx %s size: "
printk(BIOS_WARNING, "%s %02lx %s size: "
"0x%010llx not assigned in devicetree\n", dev_path(dev),
resource->index, resource_type(resource),
resource->size);
else
printk(BIOS_ERR, "ERROR: %s %02lx %s size: 0x%010llx "
printk(BIOS_ERR, "%s %02lx %s size: 0x%010llx "
"not assigned in devicetree\n", dev_path(dev), resource->index,
resource_type(resource), resource->size);
return;
@@ -145,7 +145,7 @@ static void pnp_set_resource(struct device *dev, struct resource *resource)
} else if (resource->flags & IORESOURCE_IRQ) {
pnp_set_irq(dev, resource->index, resource->base);
} else {
printk(BIOS_ERR, "ERROR: %s %02lx unknown resource type\n",
printk(BIOS_ERR, "%s %02lx unknown resource type\n",
dev_path(dev), resource->index);
return;
}
@@ -213,7 +213,7 @@ static void pnp_get_ioresource(struct device *dev, u8 index, u16 mask)
/* If none of the mask bits is set, the resource would occupy the whole
IO space leading to IO resource conflicts with the other devices */
if (!mask) {
printk(BIOS_ERR, "ERROR: device %s index %d has no mask.\n",
printk(BIOS_ERR, "device %s index %d has no mask.\n",
dev_path(dev), index);
return;
}
@@ -241,8 +241,7 @@ static void pnp_get_ioresource(struct device *dev, u8 index, u16 mask)
If there is any zero in between the block of ones, it is ignored
in the calculation of the resource size and limit. */
if (mask != (resource->limit ^ (resource->size - 1)))
printk(BIOS_WARNING,
"WARNING: mask of device %s index %d is wrong.\n",
printk(BIOS_WARNING, "mask of device %s index %d is wrong.\n",
dev_path(dev), index);
}