archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <>
To: Wolfgang Grandegger <>
Cc: Marc Kleine-Budde <>,
	"David S. Miller" <>,
	Jakub Kicinski <>,
	Vincent Mailhol <>,
	Oliver Hartkopp <>,
	Akshay Bhat <>,,,
Subject: [PATCH net] can: hi311x: fix a signedness bug in hi3110_cmd()
Date: Thu, 29 Jul 2021 17:12:46 +0300	[thread overview]
Message-ID: <20210729141246.GA1267@kili> (raw)

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 <>
 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);

             reply	other threads:[~2021-07-29 14:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 14:12 Dan Carpenter [this message]
2021-07-30  6:48 ` [PATCH net] can: hi311x: fix a signedness bug in hi3110_cmd() Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210729141246.GA1267@kili \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).