public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@kernel.org>
To: Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] pci: Show PCI bus number with hex prefix
Date: Sat, 7 Feb 2026 00:20:34 +0100	[thread overview]
Message-ID: <aYZ3QtGtUdsNVu4X@p100> (raw)

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@gmx.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,

                 reply	other threads:[~2026-02-06 23:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aYZ3QtGtUdsNVu4X@p100 \
    --to=deller@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox