[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210726130717.2052096-1-gregkh@linuxfoundation.org>
Date: Mon, 26 Jul 2021 15:07:17 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-serial@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Jordy Zomer <jordy@...ing.systems>
Subject: [PATCH] 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.
Cc: Jiri Slaby <jirislaby@...nel.org>
Reported-by: Jordy Zomer <jordy@...ing.systems>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/tty/serial/8250/8250_pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 75827b608fdb..fe64f77a9789 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -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;
--
2.32.0
Powered by blists - more mailing lists