You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
net: hns3: clean up a type mismatch warning
[ Upstream commit e79c0e324b ]
abs() returns signed long, which could not convert the type
as unsigned, and it may cause a mismatch type warning from
static tools. To fix it, this patch uses an variable to save
the abs()'s result and does a explicit conversion.
Signed-off-by: Guojia Liao <liaoguojia@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
fb1ee02787
commit
2c304c65de
@@ -10,7 +10,14 @@
|
||||
|
||||
static u16 hclge_errno_to_resp(int errno)
|
||||
{
|
||||
return abs(errno);
|
||||
int resp = abs(errno);
|
||||
|
||||
/* The status for pf to vf msg cmd is u16, constrainted by HW.
|
||||
* We need to keep the same type with it.
|
||||
* The intput errno is the stander error code, it's safely to
|
||||
* use a u16 to store the abs(errno).
|
||||
*/
|
||||
return (u16)resp;
|
||||
}
|
||||
|
||||
/* hclge_gen_resp_to_vf: used to generate a synchronous response to VF when PF
|
||||
|
||||
Reference in New Issue
Block a user