Commit db4d3d55 authored by Guangbin Huang's avatar Guangbin Huang Committed by David S. Miller

net: hns3: cleanup some coding style issues

To unify code style and make code simpler, this patch modifies
some code, deletes unnecessary blank lines and {}, changes
location of code, and so on.

No functional change.
Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d6ad7c53
...@@ -130,7 +130,6 @@ enum hnae3_module_type { ...@@ -130,7 +130,6 @@ enum hnae3_module_type {
HNAE3_MODULE_TYPE_CR = 0x04, HNAE3_MODULE_TYPE_CR = 0x04,
HNAE3_MODULE_TYPE_KR = 0x05, HNAE3_MODULE_TYPE_KR = 0x05,
HNAE3_MODULE_TYPE_TP = 0x06, HNAE3_MODULE_TYPE_TP = 0x06,
}; };
enum hnae3_fec_mode { enum hnae3_fec_mode {
......
...@@ -314,11 +314,10 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num) ...@@ -314,11 +314,10 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
} while (timeout < hw->cmq.tx_timeout); } while (timeout < hw->cmq.tx_timeout);
} }
if (!complete) { if (!complete)
retval = -EBADE; retval = -EBADE;
} else { else
retval = hclge_cmd_check_retval(hw, desc, num, ntc); retval = hclge_cmd_check_retval(hw, desc, num, ntc);
}
/* Clean the command send queue */ /* Clean the command send queue */
handle = hclge_cmd_csq_clean(hw); handle = hclge_cmd_csq_clean(hw);
......
...@@ -261,6 +261,7 @@ enum hclge_opcode_type { ...@@ -261,6 +261,7 @@ enum hclge_opcode_type {
/* NCL config command */ /* NCL config command */
HCLGE_OPC_QUERY_NCL_CONFIG = 0x7011, HCLGE_OPC_QUERY_NCL_CONFIG = 0x7011,
/* M7 stats command */ /* M7 stats command */
HCLGE_OPC_M7_STATS_BD = 0x7012, HCLGE_OPC_M7_STATS_BD = 0x7012,
HCLGE_OPC_M7_STATS_INFO = 0x7013, HCLGE_OPC_M7_STATS_INFO = 0x7013,
......
...@@ -2777,7 +2777,7 @@ static void hclge_update_port_capability(struct hclge_mac *mac) ...@@ -2777,7 +2777,7 @@ static void hclge_update_port_capability(struct hclge_mac *mac)
else if (mac->media_type == HNAE3_MEDIA_TYPE_COPPER) else if (mac->media_type == HNAE3_MEDIA_TYPE_COPPER)
mac->module_type = HNAE3_MODULE_TYPE_TP; mac->module_type = HNAE3_MODULE_TYPE_TP;
if (mac->support_autoneg == true) { if (mac->support_autoneg) {
linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, mac->supported); linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, mac->supported);
linkmode_copy(mac->advertising, mac->supported); linkmode_copy(mac->advertising, mac->supported);
} else { } else {
...@@ -3855,12 +3855,13 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle) ...@@ -3855,12 +3855,13 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle)
HCLGE_RESET_INTERVAL))) { HCLGE_RESET_INTERVAL))) {
mod_timer(&hdev->reset_timer, jiffies + HCLGE_RESET_INTERVAL); mod_timer(&hdev->reset_timer, jiffies + HCLGE_RESET_INTERVAL);
return; return;
} else if (hdev->default_reset_request) } else if (hdev->default_reset_request) {
hdev->reset_level = hdev->reset_level =
hclge_get_reset_level(ae_dev, hclge_get_reset_level(ae_dev,
&hdev->default_reset_request); &hdev->default_reset_request);
else if (time_after(jiffies, (hdev->last_reset_time + 4 * 5 * HZ))) } else if (time_after(jiffies, (hdev->last_reset_time + 4 * 5 * HZ))) {
hdev->reset_level = HNAE3_FUNC_RESET; hdev->reset_level = HNAE3_FUNC_RESET;
}
dev_info(&hdev->pdev->dev, "received reset event, reset type is %d\n", dev_info(&hdev->pdev->dev, "received reset event, reset type is %d\n",
hdev->reset_level); hdev->reset_level);
...@@ -3985,6 +3986,7 @@ static void hclge_service_task(struct work_struct *work) ...@@ -3985,6 +3986,7 @@ static void hclge_service_task(struct work_struct *work)
hclge_update_link_status(hdev); hclge_update_link_status(hdev);
hclge_update_vport_alive(hdev); hclge_update_vport_alive(hdev);
hclge_sync_vlan_filter(hdev); hclge_sync_vlan_filter(hdev);
if (hdev->fd_arfs_expire_timer >= HCLGE_FD_ARFS_EXPIRE_TIMER_INTERVAL) { if (hdev->fd_arfs_expire_timer >= HCLGE_FD_ARFS_EXPIRE_TIMER_INTERVAL) {
hclge_rfs_filter_expire(hdev); hclge_rfs_filter_expire(hdev);
hdev->fd_arfs_expire_timer = 0; hdev->fd_arfs_expire_timer = 0;
...@@ -7409,7 +7411,7 @@ void hclge_rm_vport_mac_table(struct hclge_vport *vport, const u8 *mac_addr, ...@@ -7409,7 +7411,7 @@ void hclge_rm_vport_mac_table(struct hclge_vport *vport, const u8 *mac_addr,
mc_flag = is_write_tbl && mac_type == HCLGE_MAC_ADDR_MC; mc_flag = is_write_tbl && mac_type == HCLGE_MAC_ADDR_MC;
list_for_each_entry_safe(mac_cfg, tmp, list, node) { list_for_each_entry_safe(mac_cfg, tmp, list, node) {
if (strncmp(mac_cfg->mac_addr, mac_addr, ETH_ALEN) == 0) { if (ether_addr_equal(mac_cfg->mac_addr, mac_addr)) {
if (uc_flag && mac_cfg->hd_tbl_status) if (uc_flag && mac_cfg->hd_tbl_status)
hclge_rm_uc_addr_common(vport, mac_addr); hclge_rm_uc_addr_common(vport, mac_addr);
...@@ -9093,7 +9095,6 @@ static int hclge_init_client_instance(struct hnae3_client *client, ...@@ -9093,7 +9095,6 @@ static int hclge_init_client_instance(struct hnae3_client *client,
switch (client->type) { switch (client->type) {
case HNAE3_CLIENT_KNIC: case HNAE3_CLIENT_KNIC:
hdev->nic_client = client; hdev->nic_client = client;
vport->nic.client = client; vport->nic.client = client;
ret = hclge_init_nic_client_instance(ae_dev, vport); ret = hclge_init_nic_client_instance(ae_dev, vport);
......
...@@ -2170,7 +2170,6 @@ static int hclgevf_rss_init_hw(struct hclgevf_dev *hdev) ...@@ -2170,7 +2170,6 @@ static int hclgevf_rss_init_hw(struct hclgevf_dev *hdev)
ret = hclgevf_set_rss_input_tuple(hdev, rss_cfg); ret = hclgevf_set_rss_input_tuple(hdev, rss_cfg);
if (ret) if (ret)
return ret; return ret;
} }
/* Initialize RSS indirect table */ /* Initialize RSS indirect table */
......
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