All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] net: hinic; make some cleanup for hinic
@ 2021-03-19  6:36 Daode Huang
  2021-03-19  6:36 ` [PATCH net-next 1/4] net: hinic: Remove unnecessary 'out of memory' message Daode Huang
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Daode Huang @ 2021-03-19  6:36 UTC (permalink / raw)
  To: luobin9, davem, kuba; +Cc: netdev, linux-kernel

This set try to remove the unnecessary output message, add a blank line,
remove the dupliate word and change the deprecated strlcp functions in
hinic driver, for details, please refer to each patch.

Daode Huang (4):
  net: hinic: Remove unnecessary 'out of memory' message
  net: hinic: add a blank line after declarations
  net: hinic: remove the repeat word "the" in comment.
  net: hinic: convert strlcpy to strscpy

 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c    | 4 ++--
 drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c | 8 ++------
 drivers/net/ethernet/huawei/hinic/hinic_hw_if.c      | 2 +-
 drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c    | 5 +----
 drivers/net/ethernet/huawei/hinic/hinic_hw_qp.c      | 1 -
 drivers/net/ethernet/huawei/hinic/hinic_rx.c         | 8 ++------
 drivers/net/ethernet/huawei/hinic/hinic_tx.c         | 1 +
 7 files changed, 9 insertions(+), 20 deletions(-)

-- 
2.8.1


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

* [PATCH net-next 1/4] net: hinic: Remove unnecessary 'out of memory' message
  2021-03-19  6:36 [PATCH net-next 0/4] net: hinic; make some cleanup for hinic Daode Huang
@ 2021-03-19  6:36 ` Daode Huang
  2021-03-19  6:36 ` [PATCH net-next 2/4] net: hinic: add a blank line after declarations Daode Huang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Daode Huang @ 2021-03-19  6:36 UTC (permalink / raw)
  To: luobin9, davem, kuba; +Cc: netdev, linux-kernel

This patch removes unnecessary out of memory message in hinic driver,
fixes the following checkpatch.pl warning:
"WARNING: Possible unnecessary 'out of memory' message"

Signed-off-by: Daode Huang <huangdaode@huawei.com>
---
 drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c | 8 ++------
 drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c    | 5 +----
 drivers/net/ethernet/huawei/hinic/hinic_hw_qp.c      | 1 -
 drivers/net/ethernet/huawei/hinic/hinic_rx.c         | 8 ++------
 4 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c
index 4e4029d..0658617 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c
@@ -629,10 +629,8 @@ static int alloc_cmd_buf(struct hinic_api_cmd_chain *chain,
 
 	cmd_vaddr = dma_alloc_coherent(&pdev->dev, API_CMD_BUF_SIZE,
 				       &cmd_paddr, GFP_KERNEL);
-	if (!cmd_vaddr) {
-		dev_err(&pdev->dev, "Failed to allocate API CMD DMA memory\n");
+	if (!cmd_vaddr)
 		return -ENOMEM;
-	}
 
 	cell_ctxt = &chain->cell_ctxt[cell_idx];
 
@@ -679,10 +677,8 @@ static int api_cmd_create_cell(struct hinic_api_cmd_chain *chain,
 
 	node = dma_alloc_coherent(&pdev->dev, chain->cell_size, &node_paddr,
 				  GFP_KERNEL);
-	if (!node) {
-		dev_err(&pdev->dev, "Failed to allocate dma API CMD cell\n");
+	if (!node)
 		return -ENOMEM;
-	}
 
 	node->read.hw_wb_resp_paddr = 0;
 
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c
index 819fa13..6b9b94a 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c
@@ -443,15 +443,12 @@ static void mgmt_recv_msg_handler(struct hinic_pf_to_mgmt *pf_to_mgmt,
 	struct pci_dev *pdev = pf_to_mgmt->hwif->pdev;
 
 	mgmt_work = kzalloc(sizeof(*mgmt_work), GFP_KERNEL);
-	if (!mgmt_work) {
-		dev_err(&pdev->dev, "Allocate mgmt work memory failed\n");
+	if (!mgmt_work)
 		return;
-	}
 
 	if (recv_msg->msg_len) {
 		mgmt_work->msg = kzalloc(recv_msg->msg_len, GFP_KERNEL);
 		if (!mgmt_work->msg) {
-			dev_err(&pdev->dev, "Allocate mgmt msg memory failed\n");
 			kfree(mgmt_work);
 			return;
 		}
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.c
index fcf7bfe..dcba4d0 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.c
@@ -414,7 +414,6 @@ int hinic_init_rq(struct hinic_rq *rq, struct hinic_hwif *hwif,
 	rq->pi_virt_addr = dma_alloc_coherent(&pdev->dev, pi_size,
 					      &rq->pi_dma_addr, GFP_KERNEL);
 	if (!rq->pi_virt_addr) {
-		dev_err(&pdev->dev, "Failed to allocate PI address\n");
 		err = -ENOMEM;
 		goto err_pi_virt;
 	}
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_rx.c b/drivers/net/ethernet/huawei/hinic/hinic_rx.c
index 070a7cc..cce0864 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_rx.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_rx.c
@@ -137,10 +137,8 @@ static struct sk_buff *rx_alloc_skb(struct hinic_rxq *rxq,
 	int err;
 
 	skb = netdev_alloc_skb_ip_align(rxq->netdev, rxq->rq->buf_sz);
-	if (!skb) {
-		netdev_err(rxq->netdev, "Failed to allocate Rx SKB\n");
+	if (!skb)
 		return NULL;
-	}
 
 	addr = dma_map_single(&pdev->dev, skb->data, rxq->rq->buf_sz,
 			      DMA_FROM_DEVICE);
@@ -212,10 +210,8 @@ static int rx_alloc_pkts(struct hinic_rxq *rxq)
 
 	for (i = 0; i < free_wqebbs; i++) {
 		skb = rx_alloc_skb(rxq, &dma_addr);
-		if (!skb) {
-			netdev_err(rxq->netdev, "Failed to alloc Rx skb\n");
+		if (!skb)
 			goto skb_out;
-		}
 
 		hinic_set_sge(&sge, dma_addr, skb->len);
 
-- 
2.8.1


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

* [PATCH net-next 2/4] net: hinic: add a blank line after declarations
  2021-03-19  6:36 [PATCH net-next 0/4] net: hinic; make some cleanup for hinic Daode Huang
  2021-03-19  6:36 ` [PATCH net-next 1/4] net: hinic: Remove unnecessary 'out of memory' message Daode Huang
@ 2021-03-19  6:36 ` Daode Huang
  2021-03-19  6:36 ` [PATCH net-next 3/4] net: hinic: remove the repeat word "the" in comment Daode Huang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Daode Huang @ 2021-03-19  6:36 UTC (permalink / raw)
  To: luobin9, davem, kuba; +Cc: netdev, linux-kernel

There should be a blank line after declarations, so just add it.

Signed-off-by: Daode Huang <huangdaode@huawei.com>
---
 drivers/net/ethernet/huawei/hinic/hinic_tx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_tx.c b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
index 8da7d46..710c4ff 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_tx.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
@@ -377,6 +377,7 @@ static int offload_csum(struct hinic_sq_task *task, u32 *queue_info,
 		} else if (ip.v4->version == 6) {
 			unsigned char *exthdr;
 			__be16 frag_off;
+
 			l3_type = IPV6_PKT;
 			tunnel_type = TUNNEL_UDP_CSUM;
 			exthdr = ip.hdr + sizeof(*ip.v6);
-- 
2.8.1


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

* [PATCH net-next 3/4] net: hinic: remove the repeat word "the" in comment.
  2021-03-19  6:36 [PATCH net-next 0/4] net: hinic; make some cleanup for hinic Daode Huang
  2021-03-19  6:36 ` [PATCH net-next 1/4] net: hinic: Remove unnecessary 'out of memory' message Daode Huang
  2021-03-19  6:36 ` [PATCH net-next 2/4] net: hinic: add a blank line after declarations Daode Huang
@ 2021-03-19  6:36 ` Daode Huang
  2021-03-19  6:36 ` [PATCH net-next 4/4] net: hinic: convert strlcpy to strscpy Daode Huang
  2021-03-19 19:10 ` [PATCH net-next 0/4] net: hinic; make some cleanup for hinic patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Daode Huang @ 2021-03-19  6:36 UTC (permalink / raw)
  To: luobin9, davem, kuba; +Cc: netdev, linux-kernel

There is a duplicate "the" in the comment, so delete it.

Signed-off-by: Daode Huang <huangdaode@huawei.com>
---
 drivers/net/ethernet/huawei/hinic/hinic_hw_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_if.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_if.c
index efbaed3..cab38ff 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_if.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_if.c
@@ -334,7 +334,7 @@ static void set_dma_attr(struct hinic_hwif *hwif, u32 entry_idx,
 }
 
 /**
- * dma_attr_table_init - initialize the the default dma attributes
+ * dma_attr_table_init - initialize the default dma attributes
  * @hwif: the HW interface of a pci function device
  **/
 static void dma_attr_init(struct hinic_hwif *hwif)
-- 
2.8.1


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

* [PATCH net-next 4/4] net: hinic: convert strlcpy to strscpy
  2021-03-19  6:36 [PATCH net-next 0/4] net: hinic; make some cleanup for hinic Daode Huang
                   ` (2 preceding siblings ...)
  2021-03-19  6:36 ` [PATCH net-next 3/4] net: hinic: remove the repeat word "the" in comment Daode Huang
@ 2021-03-19  6:36 ` Daode Huang
  2021-03-19 19:10 ` [PATCH net-next 0/4] net: hinic; make some cleanup for hinic patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Daode Huang @ 2021-03-19  6:36 UTC (permalink / raw)
  To: luobin9, davem, kuba; +Cc: netdev, linux-kernel

Usage of strlcpy in linux kernel has been recently
deprecated[1], so convert hinic driver to strscpy

[1] https://lore.kernel.org/lkml/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL
=V6A6G1oUZcprmknw@mail.gmail.com/

Signed-off-by: Daode Huang <huangdaode@huawei.com>
---
 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c
index c340d9a..c7848c3 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c
@@ -543,8 +543,8 @@ static void hinic_get_drvinfo(struct net_device *netdev,
 	struct hinic_hwif *hwif = hwdev->hwif;
 	int err;
 
-	strlcpy(info->driver, HINIC_DRV_NAME, sizeof(info->driver));
-	strlcpy(info->bus_info, pci_name(hwif->pdev), sizeof(info->bus_info));
+	strscpy(info->driver, HINIC_DRV_NAME, sizeof(info->driver));
+	strscpy(info->bus_info, pci_name(hwif->pdev), sizeof(info->bus_info));
 
 	err = hinic_get_mgmt_version(nic_dev, mgmt_ver);
 	if (err)
-- 
2.8.1


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

* Re: [PATCH net-next 0/4] net: hinic; make some cleanup for hinic
  2021-03-19  6:36 [PATCH net-next 0/4] net: hinic; make some cleanup for hinic Daode Huang
                   ` (3 preceding siblings ...)
  2021-03-19  6:36 ` [PATCH net-next 4/4] net: hinic: convert strlcpy to strscpy Daode Huang
@ 2021-03-19 19:10 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-03-19 19:10 UTC (permalink / raw)
  To: Daode Huang; +Cc: luobin9, davem, kuba, netdev, linux-kernel

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Fri, 19 Mar 2021 14:36:21 +0800 you wrote:
> This set try to remove the unnecessary output message, add a blank line,
> remove the dupliate word and change the deprecated strlcp functions in
> hinic driver, for details, please refer to each patch.
> 
> Daode Huang (4):
>   net: hinic: Remove unnecessary 'out of memory' message
>   net: hinic: add a blank line after declarations
>   net: hinic: remove the repeat word "the" in comment.
>   net: hinic: convert strlcpy to strscpy
> 
> [...]

Here is the summary with links:
  - [net-next,1/4] net: hinic: Remove unnecessary 'out of memory' message
    https://git.kernel.org/netdev/net-next/c/c199fdb8abf5
  - [net-next,2/4] net: hinic: add a blank line after declarations
    https://git.kernel.org/netdev/net-next/c/44401b677a52
  - [net-next,3/4] net: hinic: remove the repeat word "the" in comment.
    https://git.kernel.org/netdev/net-next/c/e2f84fd17557
  - [net-next,4/4] net: hinic: convert strlcpy to strscpy
    https://git.kernel.org/netdev/net-next/c/79d65cab7f85

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-03-19 19:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19  6:36 [PATCH net-next 0/4] net: hinic; make some cleanup for hinic Daode Huang
2021-03-19  6:36 ` [PATCH net-next 1/4] net: hinic: Remove unnecessary 'out of memory' message Daode Huang
2021-03-19  6:36 ` [PATCH net-next 2/4] net: hinic: add a blank line after declarations Daode Huang
2021-03-19  6:36 ` [PATCH net-next 3/4] net: hinic: remove the repeat word "the" in comment Daode Huang
2021-03-19  6:36 ` [PATCH net-next 4/4] net: hinic: convert strlcpy to strscpy Daode Huang
2021-03-19 19:10 ` [PATCH net-next 0/4] net: hinic; make some cleanup for hinic patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.