Commit 6e4139f6 authored by Jian Shen's avatar Jian Shen Committed by David S. Miller

net: hns3: remove unnecessary variable in hclge_get_mac_vlan_cmd_status()

The local variable return_status in hclge_get_mac_val_cmd_status()
is useless. So this patch returns the error code directly, instead of
using this variable. Also, replace some '%d' with '%u' in
hclge_get_mac_val_cmd_status().
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Reviewed-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a723fb8e
...@@ -6268,7 +6268,6 @@ static int hclge_get_mac_vlan_cmd_status(struct hclge_vport *vport, ...@@ -6268,7 +6268,6 @@ static int hclge_get_mac_vlan_cmd_status(struct hclge_vport *vport,
enum hclge_mac_vlan_tbl_opcode op) enum hclge_mac_vlan_tbl_opcode op)
{ {
struct hclge_dev *hdev = vport->back; struct hclge_dev *hdev = vport->back;
int return_status = -EIO;
if (cmdq_resp) { if (cmdq_resp) {
dev_err(&hdev->pdev->dev, dev_err(&hdev->pdev->dev,
...@@ -6279,52 +6278,53 @@ static int hclge_get_mac_vlan_cmd_status(struct hclge_vport *vport, ...@@ -6279,52 +6278,53 @@ static int hclge_get_mac_vlan_cmd_status(struct hclge_vport *vport,
if (op == HCLGE_MAC_VLAN_ADD) { if (op == HCLGE_MAC_VLAN_ADD) {
if ((!resp_code) || (resp_code == 1)) { if ((!resp_code) || (resp_code == 1)) {
return_status = 0; return 0;
} else if (resp_code == HCLGE_ADD_UC_OVERFLOW) { } else if (resp_code == HCLGE_ADD_UC_OVERFLOW) {
return_status = -ENOSPC;
dev_err(&hdev->pdev->dev, dev_err(&hdev->pdev->dev,
"add mac addr failed for uc_overflow.\n"); "add mac addr failed for uc_overflow.\n");
return -ENOSPC;
} else if (resp_code == HCLGE_ADD_MC_OVERFLOW) { } else if (resp_code == HCLGE_ADD_MC_OVERFLOW) {
return_status = -ENOSPC;
dev_err(&hdev->pdev->dev, dev_err(&hdev->pdev->dev,
"add mac addr failed for mc_overflow.\n"); "add mac addr failed for mc_overflow.\n");
} else { return -ENOSPC;
dev_err(&hdev->pdev->dev,
"add mac addr failed for undefined, code=%d.\n",
resp_code);
} }
dev_err(&hdev->pdev->dev,
"add mac addr failed for undefined, code=%u.\n",
resp_code);
return -EIO;
} else if (op == HCLGE_MAC_VLAN_REMOVE) { } else if (op == HCLGE_MAC_VLAN_REMOVE) {
if (!resp_code) { if (!resp_code) {
return_status = 0; return 0;
} else if (resp_code == 1) { } else if (resp_code == 1) {
return_status = -ENOENT;
dev_dbg(&hdev->pdev->dev, dev_dbg(&hdev->pdev->dev,
"remove mac addr failed for miss.\n"); "remove mac addr failed for miss.\n");
} else { return -ENOENT;
dev_err(&hdev->pdev->dev,
"remove mac addr failed for undefined, code=%d.\n",
resp_code);
} }
dev_err(&hdev->pdev->dev,
"remove mac addr failed for undefined, code=%u.\n",
resp_code);
return -EIO;
} else if (op == HCLGE_MAC_VLAN_LKUP) { } else if (op == HCLGE_MAC_VLAN_LKUP) {
if (!resp_code) { if (!resp_code) {
return_status = 0; return 0;
} else if (resp_code == 1) { } else if (resp_code == 1) {
return_status = -ENOENT;
dev_dbg(&hdev->pdev->dev, dev_dbg(&hdev->pdev->dev,
"lookup mac addr failed for miss.\n"); "lookup mac addr failed for miss.\n");
} else { return -ENOENT;
dev_err(&hdev->pdev->dev,
"lookup mac addr failed for undefined, code=%d.\n",
resp_code);
} }
} else {
return_status = -EINVAL;
dev_err(&hdev->pdev->dev, dev_err(&hdev->pdev->dev,
"unknown opcode for get_mac_vlan_cmd_status,opcode=%d.\n", "lookup mac addr failed for undefined, code=%u.\n",
op); resp_code);
return -EIO;
} }
return return_status; dev_err(&hdev->pdev->dev,
"unknown opcode for get_mac_vlan_cmd_status, opcode=%d.\n", op);
return -EINVAL;
} }
static int hclge_update_desc_vfid(struct hclge_desc *desc, int vfid, bool clr) static int hclge_update_desc_vfid(struct hclge_desc *desc, int vfid, bool clr)
......
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