net: hns3: add hclge_cmd_check_retval() to parse comman's return value
authorWeihang Li <liweihang@hisilicon.com>
Sat, 2 Feb 2019 14:39:30 +0000 (22:39 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Feb 2019 16:24:08 +0000 (08:24 -0800)
commitb671b723e0d235b516dc33c163e6296df9b4f0ca
tree2e126f1cff25e2b444094c6c834f52e0d2a73103
parent8ca754b13f3c3b99d946665385b3b76e66aab96d
net: hns3: add hclge_cmd_check_retval() to parse comman's return value

For simplifying the code, this patch adds hclge_cmd_check_retval() to
check the return value of the command.

Also, according the IMP's description, when there are several descriptors
in a command, then the IMP will save the return value on the last
description, so hclge_cmd_check_retval() just check the last one for this
case.

Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c