[PATCH 2/2] usb: xhci: Type check xhci_dbg_trace()

Michal Pecio
2025-10-16T16:30:04Z

xhci_dbg_trace() is a printf-like function which can be type checked
at build time. Do it to catch potential format bugs in the driver.

I found no remaining warnings on x86-64 and ARM.

Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
---
drivers/usb/host/xhci.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 485ea7fc0433..8facba10fc9c 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1788,6 +1788,7 @@ static inline bool xhci_link_chain_quirk(struct xhci_hcd *xhci, enum xhci_ring_t
/* xHCI debugging */
char *xhci_get_slot_state(struct xhci_hcd *xhci,
struct xhci_container_ctx *ctx);
+__printf(3, 4)
void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *),
const char *fmt, ...);

--
2.48.1