summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/davicom
diff options
context:
space:
mode:
authorYang Li <yang.lee@linux.alibaba.com>2022-02-16 04:45:07 +0300
committerJakub Kicinski <kuba@kernel.org>2022-02-17 07:47:52 +0300
commit8c16baa51beb50e091f6652c47fc1c8501b93611 (patch)
tree80db63a1420ccdde2bd46350d217c781dd8eedcd /drivers/net/ethernet/davicom
parentc8620335951d38f26094877f83167dfd09074224 (diff)
downloadlinux-8c16baa51beb50e091f6652c47fc1c8501b93611.tar.xz
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: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20220216014507.109117-1-yang.lee@linux.alibaba.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/davicom')
-rw-r--r--drivers/net/ethernet/davicom/dm9051.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/davicom/dm9051.c b/drivers/net/ethernet/davicom/dm9051.c
index 8436afa34620..6a2bcfbfe891 100644
--- a/drivers/net/ethernet/davicom/dm9051.c
+++ b/drivers/net/ethernet/davicom/dm9051.c
@@ -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)