From: Vasyl Gomonovych <gomonovych@gmail.com>
To: netdev@vger.kernel.org, khalasa@piap.pl, gomonovych@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] net: ethernet: ixp4xx_eth: Use dma_pool_zalloc
Date: Thu, 30 Nov 2017 22:22:18 +0100 [thread overview]
Message-ID: <1512076939-32323-1-git-send-email-gomonovych@gmail.com> (raw)
Replacing dma_pool_alloc and memset with a single call to dma_pool_zalloc
Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
drivers/net/ethernet/xscale/ixp4xx_eth.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index aee55c03def0..02f7f3e3da8d 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -1108,10 +1108,10 @@ static int init_queues(struct port *port)
return -ENOMEM;
}
- if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
- &port->desc_tab_phys)))
+ port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL,
+ &port->desc_tab_phys);
+ if (!port->desc_tab)
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
next reply other threads:[~2017-11-30 21:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-30 21:22 Vasyl Gomonovych [this message]
2017-11-30 21:32 ` [PATCH] net: ethernet: ixp4xx_eth: Use dma_pool_zalloc Gomonovych, Vasyl
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=1512076939-32323-1-git-send-email-gomonovych@gmail.com \
--to=gomonovych@gmail.com \
--cc=khalasa@piap.pl \
--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