From patchwork Thu Jul 19 14:46:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142345 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1822822ljj; Thu, 19 Jul 2018 07:48:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcHom4nVy93qo2Xp9kcSJNSNwfqZlbfNB9xv7uGuFzfX1tsknhMxnhGtcTDXktljrq3DZJM X-Received: by 2002:a17:902:a716:: with SMTP id w22-v6mr10351838plq.271.1532011686263; Thu, 19 Jul 2018 07:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532011686; cv=none; d=google.com; s=arc-20160816; b=bbwhNfJBiBP2GSfM6Q/CqjCfvllhsTYswRQREpOh2X41FbkaGuXqrV0fccIQJaEL3q 2Arg7Q98G6GzGoAJLSRHHWYE+77hhmiMV4cIFtEzYRvOFhWnLfNlFQvl+2NwHdsfnpOf TTO/DYONjjfrnHPML3I7RXGZfw9/KsbVcYhJUeygLideKsS148cOf6G17ukXeqRoLbEH 2TlV73ArjaIAeZebcwmoWmjSl9r055Ajh7lbSnVr91iJsKutANq7QriBwZOyxfwSEnDx /ZqACkdoGh3Zz9e+jZTq2iQ9NBxqevM1dXbX1P2r0WmeEZnyU2LmRXZIkZ8QFCaa21bO UYnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=IsGfBvaXXVicntikDeginQSLE+Fo/wurhT8amb1c93I=; b=BFXVDmB/iVytHKr1OpLHSX3tzfXKtKX1o5mWKpBPqrtYMGWNrFwrPS2ar3g/t7BjoJ qdtAFZQ3dsgklyNnYiyGYslwsfTtz2VqmwE8gnH2/HO3W++VJgEaE3z20kNNVnVtwqM3 RHJTVD9fYEtoHWEe2UwQBLg7aDVkOLeMTiVVNHcTlhJ4Jb9pyW1tgHcLSgaoIurHbBnK c/PEVpKHUe5waQHdodXszbp2fc/YX9u3qZZTHENcXg/wGurW55Cy24+lsCSgKYMYpxyq E6otnyg7bzqw2ZRqKTrrg7jQg1iUHaK9rVa3N2gsPBZbiA3hnlJ8OY0kXMwiFqyrPYtR kp9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12-v6si6106588pgk.391.2018.07.19.07.48.06; Thu, 19 Jul 2018 07:48:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731842AbeGSPbd (ORCPT + 31 others); Thu, 19 Jul 2018 11:31:33 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:54197 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727501AbeGSPbd (ORCPT ); Thu, 19 Jul 2018 11:31:33 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 5758218C34C4B; Thu, 19 Jul 2018 22:47:55 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 19 Jul 2018 22:47:45 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 1/9] net: hns3: Remove some redundant assignments Date: Thu, 19 Jul 2018 15:46:58 +0100 Message-ID: <20180719144706.644-2-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180719144706.644-1-salil.mehta@huawei.com> References: <20180719144706.644-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen Remove some redundant assignments, because they have been set to zero when allocate hdev. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 -- 1 file changed, 2 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 266c686..b271880 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -5595,8 +5595,6 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) hdev->pdev = pdev; hdev->ae_dev = ae_dev; hdev->reset_type = HNAE3_NONE_RESET; - hdev->reset_request = 0; - hdev->reset_pending = 0; ae_dev->priv = hdev; ret = hclge_pci_init(hdev); From patchwork Thu Jul 19 14:46:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142351 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1823168ljj; Thu, 19 Jul 2018 07:48:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc+HBhgKcfBc0ZWfTGAMllN3HgBybJJDbhtSIcLfxyRVELN7ntJqnhlSOX6XNSm3C36sDrL X-Received: by 2002:a63:90c8:: with SMTP id a191-v6mr10268466pge.173.1532011709015; Thu, 19 Jul 2018 07:48:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532011709; cv=none; d=google.com; s=arc-20160816; b=czfroW9yo/skPI5fqtoAovt4FEVRdCvKGeNXz3xTfvJJXHwPywZ/YWvAqbCp0E2tu8 bvA2ZVm1wsOfujFn+itVZlvpnxmhv1URZG3U0v85ae3iFypf5PVQgRBXt9Y5dbQzB4Qp wRWFvtleYXne7bY4b714NiBLb+M6BqufAxncEsOoNjFPdPGWvtJc2D05kWswdnaNN01T RwfIGGF5VqAhksIlVGgDqlUfQ2VlqL/oDGdtORPjk7Xq1II0QNivzUQI/SrVAxph10be u/GcZ0F7qe9YoIeI79NnNAJnQMncY/TvThak73YJd0OTeLPrUTzU/9I0cfEvBsYhMZlV 5ZZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=PYbtQ+Z5cZnsayLXpQJdS59oLiFjjbKtqQpsvrQHE54=; b=socaMyuVv+XHIUc1l4D6sVuzAqcH5eQ7gqD9tAfPYKoWn4hIlIxlQt4+RiAS0mgk2p inYrR9xN/hdVstfKTCKVUnIJtA9DL2a/GVXMkY0ABHqFda+/kacOxRcwTfETbhv1ilf4 uwBbH96V+YgorUZiAJMvHjMkhsO65b+PPu6N+bL0GYegWbzCFXbXSnWn0pEUrNNo2IvO /AzNitx61RK3zacrjH4ajNve6f+VpgIZ0Ukw142HSKEzcSBtJPa64+NaXU7FT3YX1srJ 38YEoc5QOQudELGGXRfwo8tZ/rjXHyVYJKaL8KiMloGAMdQgIt4mTDYAQtCWmnmNPwRm PCsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11-v6si5642004pgm.154.2018.07.19.07.48.28; Thu, 19 Jul 2018 07:48:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732060AbeGSPb4 (ORCPT + 31 others); Thu, 19 Jul 2018 11:31:56 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:9703 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731850AbeGSPbz (ORCPT ); Thu, 19 Jul 2018 11:31:55 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 3CE62A7767955; Thu, 19 Jul 2018 22:47:59 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 19 Jul 2018 22:47:49 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 2/9] net: hns3: Standardize the handle of return value Date: Thu, 19 Jul 2018 15:46:59 +0100 Message-ID: <20180719144706.644-3-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180719144706.644-1-salil.mehta@huawei.com> References: <20180719144706.644-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen Apply the standard minor cleanup by returning ret outside the brackets. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 133 +++++++-------------- 1 file changed, 46 insertions(+), 87 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index b271880..cca5b2f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -1108,12 +1108,12 @@ static int hclge_get_cfg(struct hclge_dev *hdev, struct hclge_cfg *hcfg) ret = hclge_cmd_send(&hdev->hw, desc, HCLGE_PF_CFG_DESC_NUM); if (ret) { - dev_err(&hdev->pdev->dev, - "get config failed %d.\n", ret); + dev_err(&hdev->pdev->dev, "get config failed %d.\n", ret); return ret; } hclge_parse_cfg(hcfg, desc); + return 0; } @@ -1130,13 +1130,10 @@ static int hclge_get_cap(struct hclge_dev *hdev) /* get pf resource */ ret = hclge_query_pf_resource(hdev); - if (ret) { - dev_err(&hdev->pdev->dev, - "query pf resource error %d.\n", ret); - return ret; - } + if (ret) + dev_err(&hdev->pdev->dev, "query pf resource error %d.\n", ret); - return 0; + return ret; } static int hclge_configure(struct hclge_dev *hdev) @@ -1265,13 +1262,10 @@ static int hclge_map_tqps_to_func(struct hclge_dev *hdev, u16 func_id, req->tqp_vid = cpu_to_le16(tqp_vid); ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { - dev_err(&hdev->pdev->dev, "TQP map failed %d.\n", - ret); - return ret; - } + if (ret) + dev_err(&hdev->pdev->dev, "TQP map failed %d.\n", ret); - return 0; + return ret; } static int hclge_assign_tqp(struct hclge_vport *vport, @@ -1330,12 +1324,10 @@ static int hclge_knic_setup(struct hclge_vport *vport, u16 num_tqps) return -ENOMEM; ret = hclge_assign_tqp(vport, kinfo->tqp, kinfo->num_tqps); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "fail to assign TQPs %d.\n", ret); - return -EINVAL; - } - return 0; + return ret; } static int hclge_map_tqp_to_vport(struct hclge_dev *hdev, @@ -1487,13 +1479,11 @@ static int hclge_cmd_alloc_tx_buff(struct hclge_dev *hdev, } ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "tx buffer alloc cmd failed %d.\n", ret); - return ret; - } - return 0; + return ret; } static int hclge_tx_buffer_alloc(struct hclge_dev *hdev, @@ -1501,13 +1491,10 @@ static int hclge_tx_buffer_alloc(struct hclge_dev *hdev, { int ret = hclge_cmd_alloc_tx_buff(hdev, buf_alloc); - if (ret) { - dev_err(&hdev->pdev->dev, - "tx buffer alloc failed %d\n", ret); - return ret; - } + if (ret) + dev_err(&hdev->pdev->dev, "tx buffer alloc failed %d\n", ret); - return 0; + return ret; } static int hclge_get_tc_num(struct hclge_dev *hdev) @@ -1825,13 +1812,11 @@ static int hclge_rx_priv_buf_alloc(struct hclge_dev *hdev, (1 << HCLGE_TC0_PRI_BUF_EN_B)); ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "rx private buffer alloc cmd failed %d\n", ret); - return ret; - } - return 0; + return ret; } static int hclge_rx_priv_wl_config(struct hclge_dev *hdev, @@ -1871,13 +1856,11 @@ static int hclge_rx_priv_wl_config(struct hclge_dev *hdev, /* Send 2 descriptor at one time */ ret = hclge_cmd_send(&hdev->hw, desc, 2); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "rx private waterline config cmd failed %d\n", ret); - return ret; - } - return 0; + return ret; } static int hclge_common_thrd_config(struct hclge_dev *hdev, @@ -1917,12 +1900,10 @@ static int hclge_common_thrd_config(struct hclge_dev *hdev, /* Send 2 descriptors at one time */ ret = hclge_cmd_send(&hdev->hw, desc, 2); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "common threshold config cmd failed %d\n", ret); - return ret; - } - return 0; + return ret; } static int hclge_common_wl_config(struct hclge_dev *hdev, @@ -1943,13 +1924,11 @@ static int hclge_common_wl_config(struct hclge_dev *hdev, req->com_wl.low |= cpu_to_le16(BIT(HCLGE_RX_PRIV_EN_B)); ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "common waterline config cmd failed %d\n", ret); - return ret; - } - return 0; + return ret; } int hclge_buffer_alloc(struct hclge_dev *hdev) @@ -2196,13 +2175,11 @@ static int hclge_query_mac_an_speed_dup(struct hclge_dev *hdev, int *speed, HCLGE_QUERY_SPEED_S); ret = hclge_parse_speed(speed_tmp, speed); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "could not parse speed(=%d), %d\n", speed_tmp, ret); - return -EIO; - } - return 0; + return ret; } static int hclge_set_autoneg_en(struct hclge_dev *hdev, bool enable) @@ -2219,13 +2196,11 @@ static int hclge_set_autoneg_en(struct hclge_dev *hdev, bool enable) req->cfg_an_cmd_flag = cpu_to_le32(flag); ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "auto neg set cmd failed %d.\n", ret); - return ret; - } - return 0; + return ret; } static int hclge_set_autoneg(struct hnae3_handle *handle, bool enable) @@ -2331,13 +2306,11 @@ static int hclge_mac_init(struct hclge_dev *hdev) mtu = ETH_DATA_LEN; ret = hclge_set_mtu(handle, mtu); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "set mtu failed ret=%d\n", ret); - return ret; - } - return 0; + return ret; } static void hclge_mbx_task_schedule(struct hclge_dev *hdev) @@ -3121,13 +3094,11 @@ static int hclge_set_rss_tc_mode(struct hclge_dev *hdev, u16 *tc_valid, } ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "Configure rss tc mode fail, status = %d\n", ret); - return ret; - } - return 0; + return ret; } static int hclge_set_rss_input_tuple(struct hclge_dev *hdev) @@ -3150,13 +3121,10 @@ static int hclge_set_rss_input_tuple(struct hclge_dev *hdev) req->ipv6_sctp_en = hdev->vport[0].rss_tuple_sets.ipv6_sctp_en; req->ipv6_fragment_en = hdev->vport[0].rss_tuple_sets.ipv6_fragment_en; ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "Configure rss input fail, status = %d\n", ret); - return ret; - } - - return 0; + return ret; } static int hclge_get_rss(struct hnae3_handle *handle, u32 *indir, @@ -3604,12 +3572,11 @@ int hclge_cmd_set_promisc_mode(struct hclge_dev *hdev, HCLGE_PROMISC_TX_EN_B | HCLGE_PROMISC_RX_EN_B; ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "Set promisc mode fail, status is %d.\n", ret); - return ret; - } - return 0; + + return ret; } void hclge_promisc_param_init(struct hclge_promisc_param *param, bool en_uc, @@ -3960,14 +3927,12 @@ static int hclge_set_mta_filter_mode(struct hclge_dev *hdev, HCLGE_CFG_MTA_MAC_SEL_S, mta_mac_sel); ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "Config mat filter mode failed for cmd_send, ret =%d.\n", ret); - return ret; - } - return 0; + return ret; } int hclge_cfg_func_mta_filter(struct hclge_dev *hdev, @@ -3986,14 +3951,12 @@ int hclge_cfg_func_mta_filter(struct hclge_dev *hdev, req->function_id = func_id; ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "Config func_id enable failed for cmd_send, ret =%d.\n", ret); - return ret; - } - return 0; + return ret; } static int hclge_set_mta_table_item(struct hclge_vport *vport, @@ -4598,13 +4561,11 @@ static int hclge_set_vlan_filter_ctrl(struct hclge_dev *hdev, u8 vlan_type, req->vlan_fe = filter_en; ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "set vlan filter fail, ret =%d.\n", ret); - return ret; - } - return 0; + return ret; } #define HCLGE_FILTER_TYPE_VF 0 @@ -4996,14 +4957,12 @@ static int hclge_set_mac_mtu(struct hclge_dev *hdev, int new_mtu) req->min_frm_size = HCLGE_MAC_MIN_FRAME; ret = hclge_cmd_send(&hdev->hw, &desc, 1); - if (ret) { + if (ret) dev_err(&hdev->pdev->dev, "set mtu fail, ret =%d.\n", ret); - return ret; - } - - hdev->mps = max_frm_size; + else + hdev->mps = max_frm_size; - return 0; + return ret; } static int hclge_set_mtu(struct hnae3_handle *handle, int new_mtu) From patchwork Thu Jul 19 14:47:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142348 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1823085ljj; Thu, 19 Jul 2018 07:48:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSioFJai1aacXA3fRMlq7bLWFc/RuYWmiPK1o5yWU+o5SJ9y6QLus4RkIMzGvC6kubstWC X-Received: by 2002:a17:902:28e9:: with SMTP id f96-v6mr10195197plb.240.1532011702650; Thu, 19 Jul 2018 07:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532011702; cv=none; d=google.com; s=arc-20160816; b=va581Gynd/WIeUZsk5QXb5XPRe8fyRDBJSPNsMf00PeqSU2bpi3Qltk1LKshIBDj8m 35/62sl0ypuLpi2CPwPJYdIIkpLUxUoh2LCM+cVpOIyxDWeG7xwxLs1nANkELHHQDsnz mviqgrn1UJEKRBeEHF5HXeoHxS3JCPEh9ntlKwIFAjX2sjwasOsUrT5rTJ86olXUueHt cbwHp6ysocqQujEGjgpRYWirwFkZnG4EAw5kXPbgIoxaa8fysg74TyEWgnDPWMGvGNpj PI9KxbdIwmE4PKywVVQuGe0DEPuN9oDrhrnFWKTki0jKRi99MTLteSKBX5lMy/MrDtJP C9Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=No1iu6JHBDrIVwBhTV7/E5sdAMYIlBLpF3kkjEszMgA=; b=hf1X0JnqeglVSiZMF2s+wjggUB/cOu/6XnNR8FQjMhH+51Td0F3hZJIAnQ6ZmAkwjL Pf1JqJaxC3jst/sAAFuLwoRLOpagCCWEUT471H2EXSj1MIuuD7T+yiBSz4X+w0aOAyiV agq22gIgpzObEHNe5ddsTkSq832JYOAQUuQPQEOHS4j1HPHQcoUU1S+nd3u1UkIdtAwS Yx/Bztj3aRoMEbkRweKU0G6T1/KseSchcMN+skTg/w9kDhzWrfo0dkEp7d7RNScse0BX NDhZjit1jxCOkXKerSMoENu8hULULMl0C/c/hGC5ZWsN+VK0ZZjvA3raQm0GpIZYg5jc iVdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e66-v6si5762523pfk.198.2018.07.19.07.48.22; Thu, 19 Jul 2018 07:48:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731947AbeGSPbt (ORCPT + 31 others); Thu, 19 Jul 2018 11:31:49 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:9702 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731847AbeGSPbs (ORCPT ); Thu, 19 Jul 2018 11:31:48 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 4CF49F04FAFC1; Thu, 19 Jul 2018 22:47:59 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 19 Jul 2018 22:47:54 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 3/9] net: hns3: Remove extra space and brackets Date: Thu, 19 Jul 2018 15:47:00 +0100 Message-ID: <20180719144706.644-4-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180719144706.644-1-salil.mehta@huawei.com> References: <20180719144706.644-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen Remove extra space and brackets. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index 656c3e6..e66a762 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -37,7 +37,7 @@ struct hclge_cmq_ring { dma_addr_t desc_dma_addr; struct hclge_desc *desc; struct hclge_desc_cb *desc_cb; - struct hclge_dev *dev; + struct hclge_dev *dev; u32 head; u32 tail; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index cca5b2f..b097988 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -4288,7 +4288,7 @@ static int hclge_add_mc_addr(struct hnae3_handle *handle, { struct hclge_vport *vport = hclge_get_vport(handle); - return hclge_add_mc_addr_common(vport, addr); + return hclge_add_mc_addr_common(vport, addr); } int hclge_add_mc_addr_common(struct hclge_vport *vport, diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index a5abf8e..b01a51d 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -77,11 +77,11 @@ /* Copper Specific Status Register */ #define HCLGE_PHY_CSS_REG 17 -#define HCLGE_PHY_MDIX_CTRL_S (5) +#define HCLGE_PHY_MDIX_CTRL_S 5 #define HCLGE_PHY_MDIX_CTRL_M GENMASK(6, 5) -#define HCLGE_PHY_MDIX_STATUS_B (6) -#define HCLGE_PHY_SPEED_DUP_RESOLVE_B (11) +#define HCLGE_PHY_MDIX_STATUS_B 6 +#define HCLGE_PHY_SPEED_DUP_RESOLVE_B 11 /* Factor used to calculate offset and bitmap of VF num */ #define HCLGE_VF_NUM_PER_CMD 64 From patchwork Thu Jul 19 14:47:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142350 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1823123ljj; Thu, 19 Jul 2018 07:48:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcIZbgevGPfGAcgETgiM8D2p053mcgJfvyh9M1GUR55OnwX8SYtSCAA2V9lT6q5gzT3KuDu X-Received: by 2002:a63:d5b:: with SMTP id 27-v6mr10141616pgn.107.1532011705985; Thu, 19 Jul 2018 07:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532011705; cv=none; d=google.com; s=arc-20160816; b=OegpTEJ/Rgti5rEK1OQrNPxqsspHzLIZBB+kafHqbPHhYDPHyD7yP0I/Gurp3cPSif NjRc0Zil42GNmV8bLCFWeVXdBV+8e9NI7Dv/bcdStAoS0AB2PbJ+3OtVS5yJGYcgh4zh RCjuIyb1wmlJbnJzcc8oV0X9U47vd7owKcqgMSc4hiKGiBTsVBe9YU9uBeTUehfpMDAX Lk8LINk+K78g1qInCGBNEqCfmzNTnWtGDXURvUW/T7m0NqBhdg904Re1R1vyRWt5zFSS V13CYNv9zuojsecnpT9mkSsFUTMM4CQ1T1IM5Tm+kZkcB37qPKozQJL0ZhBc1lCNNrmR Uehg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=btGxP2GZXEz8f05YCgpGrFxAfbUFVQace1JxOoGmvJ8=; b=GqF2yNIvligcHmji1exfG8SbBVQ1Bz2vki6OrEB1x5CVhpuIEzOqerDENecRyPRQRi PrjxJ6cKUtfK/SE3kiXUUtx7mi1sK8CFbrN/epS96omYFAMKxN/vhqS0mF6DiUxtzcAG 7K2U1lEs7/hZcVt8m9PL3tLH5fOyMDMOYknKPKhBBJY4oSIFlR6JNjUIHRJC9fA/ngrx 82LI42Xk9bvvALN0v9254us5lIVzHBkX6dFR7+peJrJ0Uk51qDUdFfGACUnrXeSAabkr nYRZsZDyr3s35/FSs6jF4Q5uWK6SneTEYHbn9TiNFV12gobXgvQya1t5vK+Kw2jLnRIy gHIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v16-v6si5601542pfm.341.2018.07.19.07.48.25; Thu, 19 Jul 2018 07:48:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732024AbeGSPbx (ORCPT + 31 others); Thu, 19 Jul 2018 11:31:53 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9659 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731918AbeGSPbw (ORCPT ); Thu, 19 Jul 2018 11:31:52 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id ADF70F7A1C220; Thu, 19 Jul 2018 22:48:04 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 19 Jul 2018 22:47:57 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 4/9] net: hns3: Correct unreasonable code comments Date: Thu, 19 Jul 2018 15:47:01 +0100 Message-ID: <20180719144706.644-5-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180719144706.644-1-salil.mehta@huawei.com> References: <20180719144706.644-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen This patch fixes some comment spelling errors, removes redundant comments, rewrites misleading comments, and adds some necessary comments. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 33 ++++++++++------------ .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 1 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 13 +++++---- 3 files changed, 23 insertions(+), 24 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index e66a762..940c159 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -71,7 +71,7 @@ struct hclge_misc_vector { struct hclge_cmq { struct hclge_cmq_ring csq; struct hclge_cmq_ring crq; - u16 tx_timeout; /* Tx timeout */ + u16 tx_timeout; enum hclge_cmd_status last_status; }; @@ -90,7 +90,7 @@ struct hclge_cmq { #define HCLGE_CMD_FLAG_ERR_INTR BIT(HCLGE_CMD_FLAG_ERR_INTR_SHIFT) enum hclge_opcode_type { - /* Generic command */ + /* Generic commands */ HCLGE_OPC_QUERY_FW_VER = 0x0001, HCLGE_OPC_CFG_RST_TRIGGER = 0x0020, HCLGE_OPC_GBL_RST_STATUS = 0x0021, @@ -106,18 +106,16 @@ enum hclge_opcode_type { HCLGE_OPC_QUERY_REG_NUM = 0x0040, HCLGE_OPC_QUERY_32_BIT_REG = 0x0041, HCLGE_OPC_QUERY_64_BIT_REG = 0x0042, - /* Device management command */ - /* MAC commond */ + /* MAC command */ HCLGE_OPC_CONFIG_MAC_MODE = 0x0301, HCLGE_OPC_CONFIG_AN_MODE = 0x0304, HCLGE_OPC_QUERY_AN_RESULT = 0x0306, HCLGE_OPC_QUERY_LINK_STATUS = 0x0307, HCLGE_OPC_CONFIG_MAX_FRM_SIZE = 0x0308, HCLGE_OPC_CONFIG_SPEED_DUP = 0x0309, - /* MACSEC command */ - /* PFC/Pause CMD*/ + /* PFC/Pause commands */ HCLGE_OPC_CFG_MAC_PAUSE_EN = 0x0701, HCLGE_OPC_CFG_PFC_PAUSE_EN = 0x0702, HCLGE_OPC_CFG_MAC_PARA = 0x0703, @@ -148,7 +146,7 @@ enum hclge_opcode_type { HCLGE_OPC_TM_QS_SCH_MODE_CFG = 0x0814, HCLGE_OPC_TM_BP_TO_QSET_MAPPING = 0x0815, - /* Packet buffer allocate command */ + /* Packet buffer allocate commands */ HCLGE_OPC_TX_BUFF_ALLOC = 0x0901, HCLGE_OPC_RX_PRIV_BUFF_ALLOC = 0x0902, HCLGE_OPC_RX_PRIV_WL_ALLOC = 0x0903, @@ -156,11 +154,10 @@ enum hclge_opcode_type { HCLGE_OPC_RX_COM_WL_ALLOC = 0x0905, HCLGE_OPC_RX_GBL_PKT_CNT = 0x0906, - /* PTP command */ /* TQP management command */ HCLGE_OPC_SET_TQP_MAP = 0x0A01, - /* TQP command */ + /* TQP commands */ HCLGE_OPC_CFG_TX_QUEUE = 0x0B01, HCLGE_OPC_QUERY_TX_POINTER = 0x0B02, HCLGE_OPC_QUERY_TX_STATUS = 0x0B03, @@ -172,10 +169,10 @@ enum hclge_opcode_type { HCLGE_OPC_CFG_COM_TQP_QUEUE = 0x0B20, HCLGE_OPC_RESET_TQP_QUEUE = 0x0B22, - /* TSO cmd */ + /* TSO command */ HCLGE_OPC_TSO_GENERIC_CONFIG = 0x0C01, - /* RSS cmd */ + /* RSS commands */ HCLGE_OPC_RSS_GENERIC_CONFIG = 0x0D01, HCLGE_OPC_RSS_INDIR_TABLE = 0x0D07, HCLGE_OPC_RSS_TC_MODE = 0x0D08, @@ -184,15 +181,15 @@ enum hclge_opcode_type { /* Promisuous mode command */ HCLGE_OPC_CFG_PROMISC_MODE = 0x0E01, - /* Vlan offload command */ + /* Vlan offload commands */ HCLGE_OPC_VLAN_PORT_TX_CFG = 0x0F01, HCLGE_OPC_VLAN_PORT_RX_CFG = 0x0F02, - /* Interrupts cmd */ + /* Interrupts commands */ HCLGE_OPC_ADD_RING_TO_VECTOR = 0x1503, HCLGE_OPC_DEL_RING_TO_VECTOR = 0x1504, - /* MAC command */ + /* MAC commands */ HCLGE_OPC_MAC_VLAN_ADD = 0x1000, HCLGE_OPC_MAC_VLAN_REMOVE = 0x1001, HCLGE_OPC_MAC_VLAN_TYPE_ID = 0x1002, @@ -201,13 +198,13 @@ enum hclge_opcode_type { HCLGE_OPC_MAC_ETHTYPE_REMOVE = 0x1011, HCLGE_OPC_MAC_VLAN_MASK_SET = 0x1012, - /* Multicast linear table cmd */ + /* Multicast linear table commands */ HCLGE_OPC_MTA_MAC_MODE_CFG = 0x1020, HCLGE_OPC_MTA_MAC_FUNC_CFG = 0x1021, HCLGE_OPC_MTA_TBL_ITEM_CFG = 0x1022, HCLGE_OPC_MTA_TBL_ITEM_QUERY = 0x1023, - /* VLAN command */ + /* VLAN commands */ HCLGE_OPC_VLAN_FILTER_CTRL = 0x1100, HCLGE_OPC_VLAN_FILTER_PF_CFG = 0x1101, HCLGE_OPC_VLAN_FILTER_VF_CFG = 0x1102, @@ -215,7 +212,7 @@ enum hclge_opcode_type { /* MDIO command */ HCLGE_OPC_MDIO_CONFIG = 0x1900, - /* QCN command */ + /* QCN commands */ HCLGE_OPC_QCN_MOD_CFG = 0x1A01, HCLGE_OPC_QCN_GRP_TMPLT_CFG = 0x1A02, HCLGE_OPC_QCN_SHAPPING_IR_CFG = 0x1A03, @@ -225,7 +222,7 @@ enum hclge_opcode_type { HCLGE_OPC_QCN_AJUST_INIT = 0x1A07, HCLGE_OPC_QCN_DFX_CNT_STATUS = 0x1A08, - /* Mailbox cmd */ + /* Mailbox command */ HCLGEVF_OPC_MBX_PF_TO_VF = 0x2000, /* Led command */ diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index b097988..de36dfb 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -5866,6 +5866,7 @@ static int hclge_set_channels(struct hnae3_handle *handle, u32 new_tqps_num) u32 *rss_indir; int ret, i; + /* Free old tqps, and reallocate with new tqp number when nic setup */ hclge_release_tqp(vport); ret = hclge_knic_setup(vport, new_tqps_num); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index b01a51d..b84a140 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -203,7 +203,10 @@ struct hlcge_tqp_stats { }; struct hclge_tqp { - struct device *dev; /* Device for DMA mapping */ + /* copy of device pointer from pci_dev, + * used when perform DMA mapping + */ + struct device *dev; struct hnae3_queue q; struct hlcge_tqp_stats tqp_stats; u16 index; /* Global index in a NIC controller */ @@ -493,13 +496,11 @@ struct hclge_dev { u16 num_tqps; /* Num task queue pairs of this PF */ u16 num_req_vfs; /* Num VFs requested for this PF */ - /* Base task tqp physical id of this PF */ - u16 base_tqp_pid; + u16 base_tqp_pid; /* Base task tqp physical id of this PF */ u16 alloc_rss_size; /* Allocated RSS task queue */ u16 rss_size_max; /* HW defined max RSS task queue */ - /* Num of guaranteed filters for this PF */ - u16 fdir_pf_filter_count; + u16 fdir_pf_filter_count; /* Num of guaranteed filters for this PF */ u16 num_alloc_vport; /* Num vports this driver supports */ u32 numa_node_mask; u16 rx_buf_len; @@ -561,7 +562,7 @@ struct hclge_dev { u32 mps; /* Max packet size */ enum hclge_mta_dmac_sel_type mta_mac_sel_type; - bool enable_mta; /* Mutilcast filter enable */ + bool enable_mta; /* Multicast filter enable */ struct hclge_vlan_type_cfg vlan_type_cfg; From patchwork Thu Jul 19 14:47:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142346 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1823019ljj; Thu, 19 Jul 2018 07:48:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeqMrN+ju/cd4kEf6Ov01v5IzhBgcn1Al9yqdOMg+doDEOpgBzpiqDIi9YI7F3VXrpBTnic X-Received: by 2002:a17:902:e281:: with SMTP id cf1-v6mr10475748plb.293.1532011698946; Thu, 19 Jul 2018 07:48:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532011698; cv=none; d=google.com; s=arc-20160816; b=g54xdqbqLcE08xpgTYmALpPL9GZUm4M4p4AyZvMVghbcsdAGostaHY3o0e4XdJM/FO 9frJMkQdZYV2E+Oux6arsmXkO8pyaF9dPSpbJTqAYEOUTni3rdu6YkXeX2BP/odjssCy Wvi+dKWo5pdtPzQsgMZ/gAeCJquyknLFZZJe9QYF06G0vUX1mCLqTqTGk7Wova6y4pQh Wlt3NhfxFWOH2k/WkHi9IRN83rRdp0YrTFL9C8ZWRCg7GJ5pkVb6OOPBz8hp6keAG9q+ jPToPQwml+nkUQfKgS8hWEJNNFQrVnNFu8cuoms9KEfD2cE9xh63c3TofqgDEVusNPEe fLcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=fYp87y+gvIUQm7iTuOyLSql0Qx2qIrCHLqv3E9z5g+M=; b=rDiUfOD9aUrzuZsCfCpaCy/+qGfq0jm909yOga9I1eXhP7uOCaYgrJIcnxJkTXNC3P ED04Ufxk/fKYqHRfTFyfvVoqkxe3Z/DptsiYRWI6cMR1hBSxBS6vFG9dX8Uz2TiJCIKJ uGvJ01tNR+IKH+hetQKOWu8BuW1W4uWqO35N90WqWJVykRcMjZ939WpzwYp84oeJJUQn JVtA0j5hGX6+xJGkqCnlXMh1MHe8vc9monnDLGIBN7eHoZPv8o6j8wjjqvVTVoAmz9FW jEqK5IVE2waqP8X0kEVYoSb1/ex0K00RjTTSxLrN+yBOGTBt34mwneRYt2LS+ePwy20U LCCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8-v6si6235443pgr.461.2018.07.19.07.48.18; Thu, 19 Jul 2018 07:48:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731883AbeGSPbq (ORCPT + 31 others); Thu, 19 Jul 2018 11:31:46 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:46616 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731732AbeGSPbq (ORCPT ); Thu, 19 Jul 2018 11:31:46 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C730C9AAC6888; Thu, 19 Jul 2018 22:48:09 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 19 Jul 2018 22:48:00 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 5/9] net: hns3: Use decimal for bit offset macros Date: Thu, 19 Jul 2018 15:47:02 +0100 Message-ID: <20180719144706.644-6-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180719144706.644-1-salil.mehta@huawei.com> References: <20180719144706.644-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen Using hex for bit offsets is inconsistent with the rest of the file. Change them to decimal. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 24 +++++++++++----------- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index 940c159..219ffc7 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -579,13 +579,13 @@ enum hclge_mac_vlan_tbl_opcode { HCLGE_MAC_VLAN_LKUP, /* Lookup a entry through mac_vlan key */ }; -#define HCLGE_MAC_VLAN_BIT0_EN_B 0x0 -#define HCLGE_MAC_VLAN_BIT1_EN_B 0x1 -#define HCLGE_MAC_EPORT_SW_EN_B 0xc -#define HCLGE_MAC_EPORT_TYPE_B 0xb -#define HCLGE_MAC_EPORT_VFID_S 0x3 +#define HCLGE_MAC_VLAN_BIT0_EN_B 0 +#define HCLGE_MAC_VLAN_BIT1_EN_B 1 +#define HCLGE_MAC_EPORT_SW_EN_B 12 +#define HCLGE_MAC_EPORT_TYPE_B 11 +#define HCLGE_MAC_EPORT_VFID_S 3 #define HCLGE_MAC_EPORT_VFID_M GENMASK(10, 3) -#define HCLGE_MAC_EPORT_PFID_S 0x0 +#define HCLGE_MAC_EPORT_PFID_S 0 #define HCLGE_MAC_EPORT_PFID_M GENMASK(2, 0) struct hclge_mac_vlan_tbl_entry_cmd { u8 flags; @@ -601,7 +601,7 @@ struct hclge_mac_vlan_tbl_entry_cmd { u8 rsv2[6]; }; -#define HCLGE_VLAN_MASK_EN_B 0x0 +#define HCLGE_VLAN_MASK_EN_B 0 struct hclge_mac_vlan_mask_entry_cmd { u8 rsv0[2]; u8 vlan_mask; @@ -632,23 +632,23 @@ struct hclge_mac_mgr_tbl_entry_cmd { u8 rsv3[2]; }; -#define HCLGE_CFG_MTA_MAC_SEL_S 0x0 +#define HCLGE_CFG_MTA_MAC_SEL_S 0 #define HCLGE_CFG_MTA_MAC_SEL_M GENMASK(1, 0) -#define HCLGE_CFG_MTA_MAC_EN_B 0x7 +#define HCLGE_CFG_MTA_MAC_EN_B 7 struct hclge_mta_filter_mode_cmd { u8 dmac_sel_en; /* Use lowest 2 bit as sel_mode, bit 7 as enable */ u8 rsv[23]; }; -#define HCLGE_CFG_FUNC_MTA_ACCEPT_B 0x0 +#define HCLGE_CFG_FUNC_MTA_ACCEPT_B 0 struct hclge_cfg_func_mta_filter_cmd { u8 accept; /* Only used lowest 1 bit */ u8 function_id; u8 rsv[22]; }; -#define HCLGE_CFG_MTA_ITEM_ACCEPT_B 0x0 -#define HCLGE_CFG_MTA_ITEM_IDX_S 0x0 +#define HCLGE_CFG_MTA_ITEM_ACCEPT_B 0 +#define HCLGE_CFG_MTA_ITEM_IDX_S 0 #define HCLGE_CFG_MTA_ITEM_IDX_M GENMASK(11, 0) struct hclge_cfg_func_mta_item_cmd { __le16 item_idx; /* Only used lowest 12 bit */ diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index b84a140..aeae1ba 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -91,8 +91,8 @@ #define HCLGE_MISC_RESET_STS_REG 0x20700 #define HCLGE_MISC_VECTOR_INT_STS 0x20800 #define HCLGE_GLOBAL_RESET_REG 0x20A00 -#define HCLGE_GLOBAL_RESET_BIT 0x0 -#define HCLGE_CORE_RESET_BIT 0x1 +#define HCLGE_GLOBAL_RESET_BIT 0 +#define HCLGE_CORE_RESET_BIT 1 #define HCLGE_FUN_RST_ING 0x20C00 #define HCLGE_FUN_RST_ING_B 0 From patchwork Thu Jul 19 14:47:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142354 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1824005ljj; Thu, 19 Jul 2018 07:49:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdVG6v4qfTu+e+gZaTPsKRkKGn6m5QaIgdQTeDQlZZkYQSSFybwxONKQtQNTlFqKguBaYQM X-Received: by 2002:a62:3f99:: with SMTP id z25-v6mr9911291pfj.250.1532011755965; Thu, 19 Jul 2018 07:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532011755; cv=none; d=google.com; s=arc-20160816; b=QBEh+RHlZqo4mZj/Y37wgZvDCgwIfSIHYuew75x9pI16N94q79prV/SKT7JBbGpUui u/BgEaAY+uUh8XJwHkO4pOf22SSmZaIOCpNQroooVrzSqubBapsCDmBbRrvfNBKd1YYI AfCxsl1Z/5W0aMoX/A4EqBdJSkD1T99O3xjM97kqdS7XtG2KkXbqAps3s84/Pvegbi/j RaklhFh/DHZARI3b7CaUXNHqGgHKUyUfKDwnJ82uvcZ/QdIYQhPqAs0Nw6aJmxJ9qT3F c6bRa9+E5BxcecwlSJvKgHcR04+08w47tynuK1aYex9ING+FCzBNkx6Shn/1eYBba9aI BuAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=YjmN4G529tUOKjb8mTTer3GOLA5Zt141S72/zDGNJFQ=; b=eIBsCESn8u6A8kSNKIK4mObXM4IKMgoXJUlDzhl2yQ54qouKbxi7vG+qOPM9yUYHAk vyzZladohtkUiaQFwKIr3VoR+TvNEdf8XnyVwVjtrxh896sikChTbx+FiQNVadrykcHr F92POoHxuoX+vS9aeGIR9v2rIobBlvjHRRYoJkwh4pOgYhJWb+1Vn6axqN/IlC9fRSRF 346rLunXyAzesNilywPjE9iLjjZ79MP46YKGMH0LuCMKK4yyb/e9eUfUDiCQ66X6cxIs vxzIZ2XRH/bAs23x27RGu/99q9xNLlOFLtRm7k0Mw2xRcJ++VC6VAc1IZol50gxDYE8H XJKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12-v6si6265556pgh.264.2018.07.19.07.49.15; Thu, 19 Jul 2018 07:49:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732082AbeGSPco (ORCPT + 31 others); Thu, 19 Jul 2018 11:32:44 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:46624 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731849AbeGSPbr (ORCPT ); Thu, 19 Jul 2018 11:31:47 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D5F15DD43652F; Thu, 19 Jul 2018 22:48:09 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 19 Jul 2018 22:48:03 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 6/9] net: hns3: Modify inconsistent bit mask macros Date: Thu, 19 Jul 2018 15:47:03 +0100 Message-ID: <20180719144706.644-7-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180719144706.644-1-salil.mehta@huawei.com> References: <20180719144706.644-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen Use BIT() and GENMASK() to convert the bit mask, modify the inconsistent ones, and remove useless ones. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 25 ++++++++-------------- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 2 +- 3 files changed, 11 insertions(+), 18 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index 219ffc7..ec7b8d7 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -75,19 +75,12 @@ struct hclge_cmq { enum hclge_cmd_status last_status; }; -#define HCLGE_CMD_FLAG_IN_VALID_SHIFT 0 -#define HCLGE_CMD_FLAG_OUT_VALID_SHIFT 1 -#define HCLGE_CMD_FLAG_NEXT_SHIFT 2 -#define HCLGE_CMD_FLAG_WR_OR_RD_SHIFT 3 -#define HCLGE_CMD_FLAG_NO_INTR_SHIFT 4 -#define HCLGE_CMD_FLAG_ERR_INTR_SHIFT 5 - -#define HCLGE_CMD_FLAG_IN BIT(HCLGE_CMD_FLAG_IN_VALID_SHIFT) -#define HCLGE_CMD_FLAG_OUT BIT(HCLGE_CMD_FLAG_OUT_VALID_SHIFT) -#define HCLGE_CMD_FLAG_NEXT BIT(HCLGE_CMD_FLAG_NEXT_SHIFT) -#define HCLGE_CMD_FLAG_WR BIT(HCLGE_CMD_FLAG_WR_OR_RD_SHIFT) -#define HCLGE_CMD_FLAG_NO_INTR BIT(HCLGE_CMD_FLAG_NO_INTR_SHIFT) -#define HCLGE_CMD_FLAG_ERR_INTR BIT(HCLGE_CMD_FLAG_ERR_INTR_SHIFT) +#define HCLGE_CMD_FLAG_IN BIT(0) +#define HCLGE_CMD_FLAG_OUT BIT(1) +#define HCLGE_CMD_FLAG_NEXT BIT(2) +#define HCLGE_CMD_FLAG_WR BIT(3) +#define HCLGE_CMD_FLAG_NO_INTR BIT(4) +#define HCLGE_CMD_FLAG_ERR_INTR BIT(5) enum hclge_opcode_type { /* Generic commands */ @@ -379,7 +372,7 @@ struct hclge_pf_res_cmd { __le16 msixcap_localid_ba_nic; __le16 msixcap_localid_ba_rocee; #define HCLGE_PF_VEC_NUM_S 0 -#define HCLGE_PF_VEC_NUM_M (0xff << HCLGE_PF_VEC_NUM_S) +#define HCLGE_PF_VEC_NUM_M GENMASK(7, 0) __le16 pf_intr_vector_number; __le16 pf_own_fun_number; __le32 rsv[3]; @@ -468,8 +461,8 @@ struct hclge_rss_tc_mode_cmd { u8 rsv[8]; }; -#define HCLGE_LINK_STS_B 0 -#define HCLGE_LINK_STATUS BIT(HCLGE_LINK_STS_B) +#define HCLGE_LINK_STATUS_UP_B 0 +#define HCLGE_LINK_STATUS_UP_M BIT(HCLGE_LINK_STATUS_UP_B) struct hclge_link_status_cmd { u8 status; u8 rsv[23]; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index de36dfb..e0b617c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2349,7 +2349,7 @@ static int hclge_get_mac_link_status(struct hclge_dev *hdev) } req = (struct hclge_link_status_cmd *)desc.data; - link_status = req->status & HCLGE_LINK_STATUS; + link_status = req->status & HCLGE_LINK_STATUS_UP_M; return !!link_status; } diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index aeae1ba..a1ed6df 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -40,7 +40,7 @@ #define HCLGE_RSS_HASH_ALGO_TOEPLITZ 0 #define HCLGE_RSS_HASH_ALGO_SIMPLE 1 #define HCLGE_RSS_HASH_ALGO_SYMMETRIC 2 -#define HCLGE_RSS_HASH_ALGO_MASK 0xf +#define HCLGE_RSS_HASH_ALGO_MASK GENMASK(3, 0) #define HCLGE_RSS_CFG_TBL_NUM \ (HCLGE_RSS_IND_TBL_SIZE / HCLGE_RSS_CFG_TBL_SIZE) From patchwork Thu Jul 19 14:47:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142349 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1823108ljj; Thu, 19 Jul 2018 07:48:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqDONuhaLoDi2YBaQFzJXOYP2ZekgKbpRnjG0dprTkz+/hQu6pXbVxWuH2oNXp7kYctby+ X-Received: by 2002:a62:c8c2:: with SMTP id i63-v6mr9909390pfk.73.1532011704017; Thu, 19 Jul 2018 07:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532011704; cv=none; d=google.com; s=arc-20160816; b=fPwEkxi2uOn50isAvRXzoDRSmcffy9w+vN67iVb2uKoZLwXYhMkprS3etCQ91oNl24 qGz1rezrbf6xxKdZIAWUIX1H4ogeUjdxZsO0bHCkqLCkFNDpn46PMV0hpvI0rAmKChMt eyV7g5eaRQNeTJYTwoscMVz6Fh3U0jkU6mGBf8lgD4Ah08g5WiT5UAuNxiCv4vq5+EyO 2zRc91A2vjJmR76PUd8hNymAchr7KDk/OdjrmnN21SFETFXcwxYVtNW8AilcBsAE99VH X02tR2CFAYqm9UX0t0PRYwXxcNnoEcvpxc1+HTXY/3SRMZOHeG5ewNqrD+GXmnoTchqM ZyOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=t4VkGlB+d8q1+v+sSUVvBRR2hbKcuofQQNDd2Rx7eXo=; b=X1Ia39+e1IJxCo5KxMPj3rNjlwMyCXqe/182ADD6JK/WoUovhb2fzPDNB07UKafTug YQgDdcxJbEVSPTamCSPKBv4XXMuCkrQQ9Sh3UNodcaa+rIiwC0yW3Tfk0XMWRDBlIN/5 LC3Du0QQrausWqjhUdov2l5N9QjR1rM334imMw1tEtfl3t5TZJz0L0tP+7iJCmoTQ7EY friONQD+daFIOtNX9VCSUrJ+LgtKizR7FykudodMCyZ6GWY4AxzR1fuJha3dfF40BLc6 jTtF4BviHXqR+Vp879XQ/bTStuZUAEeSzB1puZgpw0QX8M2mbMWVuGy7x49GHzxVzD1W f05Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4-v6si6167270pfj.97.2018.07.19.07.48.23; Thu, 19 Jul 2018 07:48:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732004AbeGSPbv (ORCPT + 31 others); Thu, 19 Jul 2018 11:31:51 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:54326 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730521AbeGSPbu (ORCPT ); Thu, 19 Jul 2018 11:31:50 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7E4D2A1DF6FE; Thu, 19 Jul 2018 22:48:15 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 19 Jul 2018 22:48:06 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 7/9] net: hns3: Fix misleading parameter name Date: Thu, 19 Jul 2018 15:47:04 +0100 Message-ID: <20180719144706.644-8-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180719144706.644-1-salil.mehta@huawei.com> References: <20180719144706.644-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen The input parameter "dev" of hns3_irq_handle() is indeed used as a tqp vector, it is misleadin. The struct member "flag" is used to indicate ring type, so rename it. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 ++-- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 4 ++-- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 29be96e..ba2797e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -62,9 +62,9 @@ static const struct pci_device_id hns3_pci_tbl[] = { }; MODULE_DEVICE_TABLE(pci, hns3_pci_tbl); -static irqreturn_t hns3_irq_handle(int irq, void *dev) +static irqreturn_t hns3_irq_handle(int irq, void *vector) { - struct hns3_enet_tqp_vector *tqp_vector = dev; + struct hns3_enet_tqp_vector *tqp_vector = vector; napi_schedule(&tqp_vector->napi); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c index cf40afc..68356da 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c @@ -72,7 +72,7 @@ static int hclge_alloc_cmd_queue(struct hclge_dev *hdev, int ring_type) (ring_type == HCLGE_TYPE_CSQ) ? &hw->cmq.csq : &hw->cmq.crq; int ret; - ring->flag = ring_type; + ring->ring_type = ring_type; ring->dev = hdev; ret = hclge_alloc_cmd_desc(ring); @@ -111,7 +111,7 @@ static void hclge_cmd_config_regs(struct hclge_cmq_ring *ring) struct hclge_dev *hdev = ring->dev; struct hclge_hw *hw = &hdev->hw; - if (ring->flag == HCLGE_TYPE_CSQ) { + if (ring->ring_type == HCLGE_TYPE_CSQ) { hclge_write_dev(hw, HCLGE_NIC_CSQ_BASEADDR_L_REG, lower_32_bits(dma)); hclge_write_dev(hw, HCLGE_NIC_CSQ_BASEADDR_H_REG, diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index ec7b8d7..54e199d 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -45,7 +45,7 @@ struct hclge_cmq_ring { u16 desc_num; int next_to_use; int next_to_clean; - u8 flag; + u8 ring_type; /* cmq ring type */ spinlock_t lock; /* Command queue lock */ }; From patchwork Thu Jul 19 14:47:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142353 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1823568ljj; Thu, 19 Jul 2018 07:48:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcLe30dFk2rodZJ+uyu32FAZ0CuLWdN/xbprSPteZzDXnTHnmmysxNmxjNq8mAoD+hABbop X-Received: by 2002:a62:c98e:: with SMTP id l14-v6mr9809988pfk.10.1532011732823; Thu, 19 Jul 2018 07:48:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532011732; cv=none; d=google.com; s=arc-20160816; b=DB0MQAj2jW22RVV3UAZOPKUULNqXZ8L9rR16SBXwZT1N9dQ6mD/ZEwQ2zTv0ywDkMy f3bV5UQ1TDFkoSUaF1JNEqyDKrR9A8/RQU2adnviuwZDU/ZMt4K98msoY1RwKaOR04G6 FrTbPcSZg3YQN8G+hUX7+0m9SZsyXoPkfMzjtL6RbYJm5wxdq/n66/ti3CJuSvBUVXOH eGOaBgQDXW28JfhRcuH63gYZ4C76jtEBZzKhgpaNFIH93VZZxr7+uqYpaWQFXKAFJEBv DNGlrKxvCUpl71o4U7LuLk5mWfphB4iNYgh7bqIaHgjwQAVnAWB3nQy6mhGVskiCuSyX kYbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=2R/WYbyE1dsaVJU47yoI4ipBDvBlSTLybDz7BhunFSw=; b=lbUy5D9sm6S/ql1VWqeu6SbZ3RS2XybAw5SqvyL0QuzeIOc5uQdVMIaAqd4eR+rQUd kRGsjo70mgPdyt4QJo/zZErpzXfjibuqRKtW9kWF4CAh8YzZBr0XbGBkDv/quSw9tS5I gj+XAHBZ9BUswpyFfLWG5RoZuTHVWGbbHLnA2wvp9VkXuUcJuqeFLebwgah4dJ8esAVR 4uQea8jFy6YWUw0nEsC42oqoaoJa827xOclazi3nAMG8IHHyTirLXGf4SBj15Oy4z2vt XyKPPc9jGTghmSMVwwBjbEJD8iokQfP1kdeaXcI8z5xHaKqGxVc2v0UmxI6/FVOYStey wYgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n21-v6si6045763pgk.307.2018.07.19.07.48.52; Thu, 19 Jul 2018 07:48:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731981AbeGSPbv (ORCPT + 31 others); Thu, 19 Jul 2018 11:31:51 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:54317 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731908AbeGSPbu (ORCPT ); Thu, 19 Jul 2018 11:31:50 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 6F6ABDD007A41; Thu, 19 Jul 2018 22:48:15 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 19 Jul 2018 22:48:09 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 8/9] net: hns3: Remove unused struct member and definition Date: Thu, 19 Jul 2018 15:47:05 +0100 Message-ID: <20180719144706.644-9-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180719144706.644-1-salil.mehta@huawei.com> References: <20180719144706.644-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen The struct hclge_desc_cb and hclge_desc_cb are never used in anywhere. This patch removes them. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 7 ------- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 7 ------- 2 files changed, 14 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index 54e199d..66a534a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -27,16 +27,9 @@ struct hclge_desc { __le32 data[6]; }; -struct hclge_desc_cb { - dma_addr_t dma; - void *va; - u32 length; -}; - struct hclge_cmq_ring { dma_addr_t desc_dma_addr; struct hclge_desc *desc; - struct hclge_desc_cb *desc_cb; struct hclge_dev *dev; u32 head; u32 tail; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index a1ed6df..7d4845e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -140,12 +140,6 @@ enum hclge_evt_cause { }; #define HCLGE_MPF_ENBALE 1 -struct hclge_caps { - u16 num_tqp; - u16 num_buffer_cell; - u32 flag; - u16 vmdq; -}; enum HCLGE_MAC_SPEED { HCLGE_MAC_SPEED_10M = 10, /* 10 Mbps */ @@ -191,7 +185,6 @@ struct hclge_hw { struct hclge_mac mac; int num_vec; struct hclge_cmq cmq; - struct hclge_caps caps; }; /* TQP stats */