[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210729141246.GA1267@kili>
Date: Thu, 29 Jul 2021 17:12:46 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Wolfgang Grandegger <wg@...ndegger.com>
Cc: Marc Kleine-Budde <mkl@...gutronix.de>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Vincent Mailhol <mailhol.vincent@...adoo.fr>,
Oliver Hartkopp <socketcan@...tkopp.net>,
Akshay Bhat <akshay.bhat@...esys.com>,
linux-can@...r.kernel.org, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH net] can: hi311x: fix a signedness bug in hi3110_cmd()
The hi3110_cmd() is supposed to return zero on success and negative
error codes on failure, but it was accidentally declared as a u8 when
it needs to be an int type.
Fixes: 57e83fb9b746 ("can: hi311x: Add Holt HI-311x CAN driver")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
drivers/net/can/spi/hi311x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c
index dd17b8c53e1c..89d9c986a229 100644
--- a/drivers/net/can/spi/hi311x.c
+++ b/drivers/net/can/spi/hi311x.c
@@ -218,7 +218,7 @@ static int hi3110_spi_trans(struct spi_device *spi, int len)
return ret;
}
-static u8 hi3110_cmd(struct spi_device *spi, u8 command)
+static int hi3110_cmd(struct spi_device *spi, u8 command)
{
struct hi3110_priv *priv = spi_get_drvdata(spi);
--
2.20.1
Powered by blists - more mailing lists