lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <aYZ3QtGtUdsNVu4X@p100>
Date: Sat, 7 Feb 2026 00:20:34 +0100
From: Helge Deller <deller@...nel.org>
To: Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] pci: Show PCI bus number with hex prefix

The PCI bus number is printed as hex number (base = 16) but without the "0x"
prefix in the syslog, as can be seen here:
  pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
  pci_bus 0000:00: root bus resource [mem 0xfffffffff8000000-0xfffffffff87fffff]
  pci_bus 0000:00: root bus resource [bus 00-07]

Add the SPECIAL flag to the printk format to add the 0x prefix.

Signed-off-by: Helge Deller <deller@....de>

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index a3790c43a0ab..f52fc95981b5 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1088,7 +1088,7 @@ char *resource_string(char *buf, char *end, struct resource *res,
 		.base = 16,
 		.field_width = 2,
 		.precision = -1,
-		.flags = SMALL | ZEROPAD,
+		.flags = SPECIAL | SMALL | ZEROPAD,
 	};
 	static const struct printf_spec str_spec = {
 		.field_width = -1,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ