mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] net: Fix an ignored error return from dm9051_get_regs()
@ 2022-02-16  1:45 Yang Li
  0 siblings, 0 replies; only message in thread
From: Yang Li @ 2022-02-16  1:45 UTC (permalink / raw)
  To: davem; +Cc: kuba, josright123, netdev, linux-kernel, Yang Li, Abaci Robot

The return from the call to dm9051_get_regs() is int, it can be
a negative error code, however this is being assigned to an unsigned
int variable 'ret', so making 'ret' an int.

Eliminate the following coccicheck warning:
./drivers/net/ethernet/davicom/dm9051.c:527:5-8: WARNING: Unsigned
expression compared with zero: ret < 0

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/net/ethernet/davicom/dm9051.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/davicom/dm9051.c b/drivers/net/ethernet/davicom/dm9051.c
index d2513c97f83e..8984363624eb 100644
--- a/drivers/net/ethernet/davicom/dm9051.c
+++ b/drivers/net/ethernet/davicom/dm9051.c
@@ -519,7 +519,7 @@ static int dm9051_map_init(struct spi_device *spi, struct board_info *db)
 static int dm9051_map_chipid(struct board_info *db)
 {
 	struct device *dev = &db->spidev->dev;
-	unsigned int ret;
+	int ret;
 	unsigned short wid;
 	u8 buff[6];
 
-- 
2.20.1.7.g153144c


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-16  1:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16  1:45 [PATCH -next] net: Fix an ignored error return from dm9051_get_regs() Yang Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®