Commit 9d1c9c54 authored by Fengyan Mu's avatar Fengyan Mu Committed by mufengyan
Browse files

HNS3: Do some cleancode job to eliminate warnings

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I99GLS


CVE: NA

-------------------------------------------------------------

Do some cleancode job to eliminate warnings,including:
1. Delete useless blank lines.
2. Keep variable types consistent.
3. Handle magic numbers.

Signed-off-by: default avatarFengyan Mu <mufengyan@hisilicon.com>
parent 1f8bd8c0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -79,7 +79,6 @@ u8 hns3_unic_get_l3_type(struct net_device *netdev, u32 ol_info, u32 l234info)
	u32 l3_type;

	l3_type = hns3_get_l3_type(priv, l234info, ol_info);

	if (l3_type == HNS3_L3_TYPE_IPV4)
		return UB_IPV4_CFG_TYPE;
	else if (l3_type == HNS3_L3_TYPE_IPV6)
@@ -209,6 +208,8 @@ void hns3_unic_lp_setup_skb(struct sk_buff *skb)
void hns3_unic_lb_check_skb_data(struct hns3_enet_ring *ring,
				 struct sk_buff *skb)
{
#define HNS3_UNIC_DUMP_ROW_SIZE 16

	unsigned int nip_ctrl_len = sizeof(struct ub_nip_ctrl_fld);
	struct hns3_enet_tqp_vector *tqp_vector = ring->tqp_vector;
	struct net_device *ndev = skb->dev;
@@ -238,8 +239,8 @@ void hns3_unic_lb_check_skb_data(struct hns3_enet_ring *ring,
	if (is_success)
		tqp_vector->rx_group.total_packets++;
	else
		print_hex_dump(KERN_ERR, "ubn selftest:", DUMP_PREFIX_OFFSET,
			       16, 1, skb->data, len, true);
		print_hex_dump(KERN_ERR, "ubl selftest:", DUMP_PREFIX_OFFSET,
			       HNS3_UNIC_DUMP_ROW_SIZE, 1, skb->data, len, true);

	dev_kfree_skb_any(skb);
}
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ int hclge_init_udma_client_instance(struct hnae3_ae_dev *ae_dev,
{
	struct hclge_dev *hdev = ae_dev->priv;
	struct hnae3_client *client;
	int rst_cnt;
	u32 rst_cnt;
	int ret;

	if (!hnae3_dev_udma_supported(ae_dev) || !hdev->udma_client ||
+0 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ int hclge_unic_update_guid_list(struct hclge_vport *vport,
	ret = hclge_comm_unic_update_addr_list(&vport->mc_guid_list,
					       &vport->mguid_list_lock,
					       state, addr);

	if (ret == -ENOENT) {
		hclge_comm_format_guid_addr(format_guid_addr, addr);
		dev_err(&hdev->pdev->dev,
+0 −2
Original line number Diff line number Diff line
@@ -251,7 +251,6 @@ int hclge_unic_update_ip_list(struct hclge_vport *vport,
					       &vport->ip_list_lock,
					       state,
					       (const unsigned char *)&ip_addr);

	if (ret == -ENOENT)
		dev_err(&hdev->pdev->dev,
			"failed to delete ip %pI6c from ip list\n",
@@ -383,7 +382,6 @@ static void hclge_unic_sync_vport_ip_table(struct hclge_vport *vport)
						    &vport->ip_list,
						    &vport->ip_list_lock,
						    sync, unsync);

	if (all_added)
		vport->overflow_promisc_flags &= ~HNAE3_OVERFLOW_MPE;
	else
+0 −1
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ int hclgevf_unic_update_guid_list(struct hnae3_handle *handle,
	ret = hclge_comm_unic_update_addr_list(&hdev->mc_guid_list,
					       &hdev->mguid_list_lock,
					       state, addr);

	if (ret == -ENOENT) {
		hclge_comm_format_guid_addr(format_guid_addr, addr);
		dev_err(&hdev->pdev->dev,
Loading