]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: refactor out hclgevf_cmd_convert_err_code()
authorPeng Li <lipeng321@huawei.com>
Fri, 12 Feb 2021 03:21:02 +0000 (11:21 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Feb 2021 21:13:15 +0000 (13:13 -0800)
commitdcc3e0ff19822676a76aa80e06a4ebb802613d46
tree9883b67fb29f4fe79f8955de320c66b6fcebe10e
parentcf4a2ad4013740e2605cb273f84a5de5617df103
net: hns3: refactor out hclgevf_cmd_convert_err_code()

To improve code readability and maintainability, refactor
hclgevf_cmd_convert_err_code() with an array of imp_errcode
and common_errno mapping, instead of a bloated switch/case.

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/hns3vf/hclgevf_cmd.c