Skip to contentSkip to conversation

serial: 8250_pci: make setup_port() parameters explicitly unsigned

PATCH New Greg Kroah-Hartman 1 participant 1 message Jul 26, 2021 TTY layer and serial drivers

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 serial: 8250_pci: make setup_port() parameters explicitly unsigned

The bar and offset parameters to setup_port() are used in pointer math, and while it would be very difficult to get them to wrap as a negative number, just be "safe" and make them unsigned so that static checkers do not trip over them unintentionally.

---
 drivers/tty/serial/8250/8250_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_pci.c +1 -1
index 75827b608fdb..fe64f77a9789 100644
@@ -87,7 +87,7 @@ static void moan_device(const char *str, struct pci_dev *dev)
 
 static int
 setup_port(struct serial_private *priv, struct uart_8250_port *port,
-	   int bar, int offset, int regshift)
+	   u8 bar, unsigned int offset, int regshift)
 {
 	struct pci_dev *dev = priv->dev;
 
Signature · 1 line
2.32.0