netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Souptick Joarder <jrdr.linux@gmail.com>
To: "Krzysztof Hałasa" <khalasa@piap.pl>, netdev@vger.kernel.org
Subject: Re: [PATCH] net: Use dma_pool_zalloc()
Date: Wed, 7 Mar 2018 02:23:24 +0530	[thread overview]
Message-ID: <CAFqt6zajFfjKoipVvO1DbNG-dT7fEc6tFkAcOWq6cPbRnzSRCQ@mail.gmail.com> (raw)
In-Reply-To: <20180216162849.GA10860@jordon-HP-15-Notebook-PC>

Any comment for this patch.

On Fri, Feb 16, 2018 at 9:58 PM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> Use dma_pool_zalloc() instead of dma_pool_alloc + memset
>
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> ---
>  drivers/net/ethernet/xscale/ixp4xx_eth.c | 3 +--
>  drivers/net/wan/ixp4xx_hss.c             | 3 +--
>  2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
> index aee55c0..5710ae8 100644
> --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
> +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
> @@ -1108,10 +1108,9 @@ static int init_queues(struct port *port)
>                         return -ENOMEM;
>         }
>
> -       if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
> +       if (!(port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL,
>                                               &port->desc_tab_phys)))
>                 return -ENOMEM;
> -       memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
>         memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */
>         memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab));
>
> diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
> index 6a505c2..0caffbf 100644
> --- a/drivers/net/wan/ixp4xx_hss.c
> +++ b/drivers/net/wan/ixp4xx_hss.c
> @@ -976,10 +976,9 @@ static int init_hdlc_queues(struct port *port)
>                         return -ENOMEM;
>         }
>
> -       if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
> +       if (!(port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL,
>                                               &port->desc_tab_phys)))
>                 return -ENOMEM;
> -       memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
>         memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */
>         memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab));
>
> --
> 1.9.1
>

       reply	other threads:[~2018-03-06 20:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180216162849.GA10860@jordon-HP-15-Notebook-PC>
2018-03-06 20:53 ` Souptick Joarder [this message]
2018-03-08 13:45   ` [PATCH] net: Use dma_pool_zalloc() Krzysztof Hałasa
2018-03-08 14:32     ` Souptick Joarder

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=CAFqt6zajFfjKoipVvO1DbNG-dT7fEc6tFkAcOWq6cPbRnzSRCQ@mail.gmail.com \
    --to=jrdr.linux@gmail.com \
    --cc=khalasa@piap.pl \
    --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).