netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: <davem@davemloft.net>, <Ariel.Elior@cavium.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<everest-linux-l2@cavium.com>, YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH net-next] qed: use dma_zalloc_coherent instead of allocator/memset
Date: Mon, 4 Jun 2018 21:10:31 +0800	[thread overview]
Message-ID: <20180604131031.24476-1-yuehaibing@huawei.com> (raw)

Use dma_zalloc_coherent instead of dma_alloc_coherent
followed by memset 0.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/ethernet/qlogic/qed/qed_cxt.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
index 820b226..1835f00 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
@@ -936,14 +936,13 @@ static int qed_cxt_src_t2_alloc(struct qed_hwfn *p_hwfn)
 		u32 size = min_t(u32, total_size, psz);
 		void **p_virt = &p_mngr->t2[i].p_virt;
 
-		*p_virt = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
-					     size,
-					     &p_mngr->t2[i].p_phys, GFP_KERNEL);
+		*p_virt = dma_zalloc_coherent(&p_hwfn->cdev->pdev->dev,
+					      size, &p_mngr->t2[i].p_phys,
+					      GFP_KERNEL);
 		if (!p_mngr->t2[i].p_virt) {
 			rc = -ENOMEM;
 			goto t2_fail;
 		}
-		memset(*p_virt, 0, size);
 		p_mngr->t2[i].size = size;
 		total_size -= size;
 	}
-- 
2.7.0

             reply	other threads:[~2018-06-04 13:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 13:10 YueHaibing [this message]
2018-06-04 14:53 ` [PATCH net-next] qed: use dma_zalloc_coherent instead of allocator/memset Tayar, Tomer
2018-06-04 21:28 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180604131031.24476-1-yuehaibing@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=Ariel.Elior@cavium.com \
    --cc=davem@davemloft.net \
    --cc=everest-linux-l2@cavium.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).