summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKeith Hui <buurin@gmail.com>2023-03-18 08:29:12 -0400
committerFelix Held <felix-coreboot@felixheld.de>2023-03-29 13:17:31 +0000
commitb1cb895c27154851dfe6fcaa9a24186afa643d52 (patch)
tree5bbe3164b564efc9bd5f3a369305f71228e5cf85 /src
parentb8f1103a32da10bd16c9398a9c390438938fff03 (diff)
downloadcoreboot-b1cb895c27154851dfe6fcaa9a24186afa643d52.tar.gz
coreboot-b1cb895c27154851dfe6fcaa9a24186afa643d52.tar.bz2
coreboot-b1cb895c27154851dfe6fcaa9a24186afa643d52.zip
nb/intel/i440bx/debug.c: Refactor newlines and save some printk calls
There are two conditions within the config space dump code, one to print offset, one at the end to put a newline. Tweak the printk strings so the first conditioned printk does it all and move the second printk out of the loop to the very end. Change-Id: Ie9dc744406ba20412892df96720e88e24c3d52bc Signed-off-by: Keith Hui <buurin@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/73887 Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/northbridge/intel/i440bx/debug.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/northbridge/intel/i440bx/debug.c b/src/northbridge/intel/i440bx/debug.c
index 63b8e8ff25f2..ce808cf4211b 100644
--- a/src/northbridge/intel/i440bx/debug.c
+++ b/src/northbridge/intel/i440bx/debug.c
@@ -38,15 +38,13 @@ void dump_spd_registers(void)
void dump_pci_device(unsigned int dev)
{
int i;
- printk(BIOS_DEBUG, "PCI: %02x:%02x.%02x\n", (dev >> 20) & 0xff, (dev >> 15) & 0x1f, (dev >> 12) & 7);
+ printk(BIOS_DEBUG, "PCI: %02x:%02x.%02x", (dev >> 20) & 0xff, (dev >> 15) & 0x1f,
+ (dev >> 12) & 7);
for (i = 0; i <= 255; i++) {
- unsigned char val;
- val = pci_read_config8(dev, i);
if ((i & 0x0f) == 0)
- printk(BIOS_DEBUG, "%02x:", i);
- printk(BIOS_DEBUG, " %02x", val);
- if ((i & 0x0f) == 0x0f)
- printk(BIOS_DEBUG, "\n");
+ printk(BIOS_DEBUG, "\n%02x:", i);
+ printk(BIOS_DEBUG, " %02x", pci_read_config8(dev, i));
}
+ printk(BIOS_DEBUG, "\n");
}