* [PATCH] usb: uhci: fix CONFIG_HAS_IOPORT guard in uhci-hcd.h
@ 2026-12-04 2:02 Pengpeng Hou
2026-12-04 2:09 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-12-04 2:02 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman
Cc: Niklas Schnelle, linux-usb, linux-kernel, Pengpeng Hou
In a UHCI build supporting both PCI and non-PCI host controllers, the
register-access helper tests HAS_IOPORT instead of CONFIG_HAS_IOPORT.
This prevents selection of the port-I/O path even for a PCI controller
with an I/O base.
Use the actual configuration symbol, as the companion code already does.
Keep MMIO for the non-PCI case.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: dc54ce3e603b ("usb: uhci: handle HAS_IOPORT dependencies")
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
The original patch was prepared with Gemini. Codex assisted with this
review and revision (Assisted-by: gpt 5).
Built uhci-hcd.o for ARM with Clang 18 and W=1 using the same mixed PCI
and non-PCI configuration before and after the change. The preprocessed
UHCI code gained the runtime PCI I/O-address check. No controller was
exercised.
drivers/usb/host/uhci-hcd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
index 4326d1f3ca768d02cf241f5c1275a840f504b711..f66bd22638dac06cacc684f5d2f7bcbf0fa5deb3 100644
--- a/drivers/usb/host/uhci-hcd.h
+++ b/drivers/usb/host/uhci-hcd.h
@@ -548,7 +548,7 @@ static inline void uhci_writeb(const struct uhci_hcd *uhci, u8 val, int reg)
#else
/* Support non-PCI host controllers */
-#if defined(CONFIG_USB_PCI) && defined(HAS_IOPORT)
+#if defined(CONFIG_USB_PCI) && defined(CONFIG_HAS_IOPORT)
/* Support PCI and non-PCI host controllers */
#define uhci_has_pci_registers(u) ((u)->io_addr != 0)
#else
base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-04 2:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 2:02 [PATCH] usb: uhci: fix CONFIG_HAS_IOPORT guard in uhci-hcd.h Pengpeng Hou
2026-12-04 2:09 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox