Commit 8c16baa5 authored by Yang Li's avatar Yang Li Committed by Jakub Kicinski

net: Fix an ignored error return from dm9051_get_regs()

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: default avatarAbaci Robot <abaci@linux.alibaba.com>
Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220216014507.109117-1-yang.lee@linux.alibaba.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c8620335
......@@ -519,9 +519,9 @@ 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;
unsigned short wid;
u8 buff[6];
int ret;
ret = dm9051_get_regs(db, DM9051_VIDL, buff, sizeof(buff));
if (ret < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment