Netdev List
 help / color / mirror / Atom feed
From: Jes Sorensen <jes.sorensen@gmail.com>
To: Fuqian Huang <huangfq.daxian@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 80/87] net: hippi: remove memset after pci_alloc_consistent
Date: Thu, 27 Jun 2019 16:06:32 -0400	[thread overview]
Message-ID: <518f3f6a-9d1b-11f8-e900-fcdc9e140110@gmail.com> (raw)
In-Reply-To: <20190627174452.5677-1-huangfq.daxian@gmail.com>

On 6/27/19 1:44 PM, Fuqian Huang wrote:
> pci_alloc_consistent calls dma_alloc_coherent directly.
> In commit af7ddd8a627c
> ("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"),
> dma_alloc_coherent has already zeroed the memory.
> So memset is not needed.
> 
> Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
> ---
>  drivers/net/hippi/rrunner.c | 2 --
>  1 file changed, 2 deletions(-)

Acked-by: Jes Sorensen <Jes.Sorensen@gmail.com>

> diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
> index 7b9350dbebdd..2a6ec5394966 100644
> --- a/drivers/net/hippi/rrunner.c
> +++ b/drivers/net/hippi/rrunner.c
> @@ -1196,7 +1196,6 @@ static int rr_open(struct net_device *dev)
>  		goto error;
>  	}
>  	rrpriv->rx_ctrl_dma = dma_addr;
> -	memset(rrpriv->rx_ctrl, 0, 256*sizeof(struct ring_ctrl));
>  
>  	rrpriv->info = pci_alloc_consistent(pdev, sizeof(struct rr_info),
>  					    &dma_addr);
> @@ -1205,7 +1204,6 @@ static int rr_open(struct net_device *dev)
>  		goto error;
>  	}
>  	rrpriv->info_dma = dma_addr;
> -	memset(rrpriv->info, 0, sizeof(struct rr_info));
>  	wmb();
>  
>  	spin_lock_irqsave(&rrpriv->lock, flags);
> 


      reply	other threads:[~2019-06-27 20:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27 17:44 [PATCH 80/87] net: hippi: remove memset after pci_alloc_consistent Fuqian Huang
2019-06-27 20:06 ` Jes Sorensen [this message]

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=518f3f6a-9d1b-11f8-e900-fcdc9e140110@gmail.com \
    --to=jes.sorensen@gmail.com \
    --cc=davem@davemloft.net \
    --cc=huangfq.daxian@gmail.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