linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/6] net: hns3: adds some cleanups for -next
@ 2020-05-30  1:08 Huazhong Tan
  2020-05-30  1:08 ` [PATCH net-next 1/6] net: hns3: fix a print format issue in hclge_mac_mdio_config() Huazhong Tan
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Huazhong Tan @ 2020-05-30  1:08 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

There are some cleanups for the HNS3 ethernet driver, fix an
incorrect print format, an incorrect comment and some coding
style issues, also remove some unused codes and macros.

Huazhong Tan (6):
  net: hns3: fix a print format issue in hclge_mac_mdio_config()
  net: hns3: remove an unused macro hclge_is_csq
  net: hns3: remove two unused macros in hclgevf_cmd.c
  net: hns3: fix an incorrect comment for num_tqps in struct hclgevf_dev
  net: hns3: fix two coding style issues in hclgevf_main.c
  net: hns3: remove some unused codes in hns3_nic_set_features()

 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c           | 6 ------
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c    | 2 --
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c   | 2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c  | 3 ---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 3 +--
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 2 +-
 6 files changed, 3 insertions(+), 15 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net-next 1/6] net: hns3: fix a print format issue in hclge_mac_mdio_config()
  2020-05-30  1:08 [PATCH net-next 0/6] net: hns3: adds some cleanups for -next Huazhong Tan
@ 2020-05-30  1:08 ` Huazhong Tan
  2020-05-30  1:08 ` [PATCH net-next 2/6] net: hns3: remove an unused macro hclge_is_csq Huazhong Tan
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Huazhong Tan @ 2020-05-30  1:08 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

Use %d to print int variable 'ret' in hclge_mac_mdio_config().

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
index 696c5ae..e898207 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
@@ -155,7 +155,7 @@ int hclge_mac_mdio_config(struct hclge_dev *hdev)
 	ret = mdiobus_register(mdio_bus);
 	if (ret) {
 		dev_err(mdio_bus->parent,
-			"Failed to register MDIO bus ret = %#x\n", ret);
+			"failed to register MDIO bus, ret = %d\n", ret);
 		return ret;
 	}
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next 2/6] net: hns3: remove an unused macro hclge_is_csq
  2020-05-30  1:08 [PATCH net-next 0/6] net: hns3: adds some cleanups for -next Huazhong Tan
  2020-05-30  1:08 ` [PATCH net-next 1/6] net: hns3: fix a print format issue in hclge_mac_mdio_config() Huazhong Tan
@ 2020-05-30  1:08 ` Huazhong Tan
  2020-05-30  1:08 ` [PATCH net-next 3/6] net: hns3: remove two unused macros in hclgevf_cmd.c Huazhong Tan
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Huazhong Tan @ 2020-05-30  1:08 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

Macro hclge_is_csq defined in hcgle_cmd.c has not been used,
so remove it.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
index 64a1d0bd..1d6c328 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
@@ -11,8 +11,6 @@
 #include "hnae3.h"
 #include "hclge_main.h"
 
-#define hclge_is_csq(ring) ((ring)->flag & HCLGE_TYPE_CSQ)
-
 #define cmq_ring_to_dev(ring)   (&(ring)->dev->pdev->dev)
 
 static int hclge_ring_space(struct hclge_cmq_ring *ring)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next 3/6] net: hns3: remove two unused macros in hclgevf_cmd.c
  2020-05-30  1:08 [PATCH net-next 0/6] net: hns3: adds some cleanups for -next Huazhong Tan
  2020-05-30  1:08 ` [PATCH net-next 1/6] net: hns3: fix a print format issue in hclge_mac_mdio_config() Huazhong Tan
  2020-05-30  1:08 ` [PATCH net-next 2/6] net: hns3: remove an unused macro hclge_is_csq Huazhong Tan
@ 2020-05-30  1:08 ` Huazhong Tan
  2020-05-30  1:08 ` [PATCH net-next 4/6] net: hns3: fix an incorrect comment for num_tqps in struct hclgevf_dev Huazhong Tan
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Huazhong Tan @ 2020-05-30  1:08 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

Macro hclgevf_ring_to_dma_dir and hclgevf_is_csq defined in
hclgevf_cmd.c, but not used, so remove them.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c
index f38d236..fec65239 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c
@@ -11,9 +11,6 @@
 #include "hclgevf_main.h"
 #include "hnae3.h"
 
-#define hclgevf_is_csq(ring) ((ring)->flag & HCLGEVF_TYPE_CSQ)
-#define hclgevf_ring_to_dma_dir(ring) (hclgevf_is_csq(ring) ? \
-					DMA_TO_DEVICE : DMA_FROM_DEVICE)
 #define cmq_ring_to_dev(ring)   (&(ring)->dev->pdev->dev)
 
 static int hclgevf_ring_space(struct hclgevf_cmq_ring *ring)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next 4/6] net: hns3: fix an incorrect comment for num_tqps in struct hclgevf_dev
  2020-05-30  1:08 [PATCH net-next 0/6] net: hns3: adds some cleanups for -next Huazhong Tan
                   ` (2 preceding siblings ...)
  2020-05-30  1:08 ` [PATCH net-next 3/6] net: hns3: remove two unused macros in hclgevf_cmd.c Huazhong Tan
@ 2020-05-30  1:08 ` Huazhong Tan
  2020-05-30  1:08 ` [PATCH net-next 5/6] net: hns3: fix two coding style issues in hclgevf_main.c Huazhong Tan
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Huazhong Tan @ 2020-05-30  1:08 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

struct hclgevf_dev stands for VF device, its field num_tqps
indicates the number of VF's task queue pairs, so the comment
is incorrect, replace 'PF' with 'VF'.

Reported-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
index 738de12..c1fac89 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
@@ -278,7 +278,7 @@ struct hclgevf_dev {
 	struct semaphore reset_sem;	/* protect reset process */
 
 	u32 fw_version;
-	u16 num_tqps;		/* num task queue pairs of this PF */
+	u16 num_tqps;		/* num task queue pairs of this VF */
 
 	u16 alloc_rss_size;	/* allocated RSS task queue */
 	u16 rss_size_max;	/* HW defined max RSS task queue */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next 5/6] net: hns3: fix two coding style issues in hclgevf_main.c
  2020-05-30  1:08 [PATCH net-next 0/6] net: hns3: adds some cleanups for -next Huazhong Tan
                   ` (3 preceding siblings ...)
  2020-05-30  1:08 ` [PATCH net-next 4/6] net: hns3: fix an incorrect comment for num_tqps in struct hclgevf_dev Huazhong Tan
@ 2020-05-30  1:08 ` Huazhong Tan
  2020-05-30  1:08 ` [PATCH net-next 6/6] net: hns3: remove some unused codes in hns3_nic_set_features() Huazhong Tan
  2020-05-31  0:41 ` [PATCH net-next 0/6] net: hns3: adds some cleanups for -next David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Huazhong Tan @ 2020-05-30  1:08 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

Remove a redundant blank line in hclgevf_cmd_set_promisc_mode(),
and fix a reverse xmas tree coding style issue in
hclgevf_set_rss_tc_mode().

Reported-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index a8c0e79..1b9578d 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -669,8 +669,8 @@ static int hclgevf_set_rss_tc_mode(struct hclgevf_dev *hdev,  u16 rss_size)
 	u16 tc_size[HCLGEVF_MAX_TC_NUM];
 	struct hclgevf_desc desc;
 	u16 roundup_size;
-	int status;
 	unsigned int i;
+	int status;
 
 	req = (struct hclgevf_rss_tc_mode_cmd *)desc.data;
 
@@ -1143,7 +1143,6 @@ static int hclgevf_cmd_set_promisc_mode(struct hclgevf_dev *hdev,
 	send_msg.en_mc = en_mc_pmc ? 1 : 0;
 
 	ret = hclgevf_send_mbx_msg(hdev, &send_msg, false, NULL, 0);
-
 	if (ret)
 		dev_err(&hdev->pdev->dev,
 			"Set promisc mode fail, status is %d.\n", ret);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next 6/6] net: hns3: remove some unused codes in hns3_nic_set_features()
  2020-05-30  1:08 [PATCH net-next 0/6] net: hns3: adds some cleanups for -next Huazhong Tan
                   ` (4 preceding siblings ...)
  2020-05-30  1:08 ` [PATCH net-next 5/6] net: hns3: fix two coding style issues in hclgevf_main.c Huazhong Tan
@ 2020-05-30  1:08 ` Huazhong Tan
  2020-05-31  0:41 ` [PATCH net-next 0/6] net: hns3: adds some cleanups for -next David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Huazhong Tan @ 2020-05-30  1:08 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

NETIF_F_HW_VLAN_CTAG_FILTER is not set in netdev->hw_feature for
the HNS3 driver, so the handler of NETIF_F_HW_VLAN_CTAG_FILTER
in hns3_nic_set_features() won't be called, remove it.

Reported-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 9fe40c7..b14f2ab 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -1544,12 +1544,6 @@ static int hns3_nic_set_features(struct net_device *netdev,
 			return ret;
 	}
 
-	if ((changed & NETIF_F_HW_VLAN_CTAG_FILTER) &&
-	    h->ae_algo->ops->enable_vlan_filter) {
-		enable = !!(features & NETIF_F_HW_VLAN_CTAG_FILTER);
-		h->ae_algo->ops->enable_vlan_filter(h, enable);
-	}
-
 	if ((changed & NETIF_F_HW_VLAN_CTAG_RX) &&
 	    h->ae_algo->ops->enable_hw_strip_rxvtag) {
 		enable = !!(features & NETIF_F_HW_VLAN_CTAG_RX);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 0/6] net: hns3: adds some cleanups for -next
  2020-05-30  1:08 [PATCH net-next 0/6] net: hns3: adds some cleanups for -next Huazhong Tan
                   ` (5 preceding siblings ...)
  2020-05-30  1:08 ` [PATCH net-next 6/6] net: hns3: remove some unused codes in hns3_nic_set_features() Huazhong Tan
@ 2020-05-31  0:41 ` David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2020-05-31  0:41 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Sat, 30 May 2020 09:08:26 +0800

> There are some cleanups for the HNS3 ethernet driver, fix an
> incorrect print format, an incorrect comment and some coding
> style issues, also remove some unused codes and macros.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-31  0:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-30  1:08 [PATCH net-next 0/6] net: hns3: adds some cleanups for -next Huazhong Tan
2020-05-30  1:08 ` [PATCH net-next 1/6] net: hns3: fix a print format issue in hclge_mac_mdio_config() Huazhong Tan
2020-05-30  1:08 ` [PATCH net-next 2/6] net: hns3: remove an unused macro hclge_is_csq Huazhong Tan
2020-05-30  1:08 ` [PATCH net-next 3/6] net: hns3: remove two unused macros in hclgevf_cmd.c Huazhong Tan
2020-05-30  1:08 ` [PATCH net-next 4/6] net: hns3: fix an incorrect comment for num_tqps in struct hclgevf_dev Huazhong Tan
2020-05-30  1:08 ` [PATCH net-next 5/6] net: hns3: fix two coding style issues in hclgevf_main.c Huazhong Tan
2020-05-30  1:08 ` [PATCH net-next 6/6] net: hns3: remove some unused codes in hns3_nic_set_features() Huazhong Tan
2020-05-31  0:41 ` [PATCH net-next 0/6] net: hns3: adds some cleanups for -next David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).