linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "David S. Miller" <davem@davemloft.net>,
	Thomas Bogendoerfer <tbogendoerfer@suse.de>
Cc: linux-mips@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] net: sgi: ioc3-eth: fix usage of GFP_* flags
Date: Wed, 30 Oct 2019 14:12:31 -0700	[thread overview]
Message-ID: <20191030211233.30157-3-hch@lst.de> (raw)
In-Reply-To: <20191030211233.30157-1-hch@lst.de>

dma_alloc_coherent always zeroes memory, there is no need for
__GFP_ZERO.  Also doing a GFP_ATOMIC allocation just before a GFP_KERNEL
one is clearly bogus.

Fixes: ed870f6a7aa2 ("net: sgi: ioc3-eth: use dma-direct for dma allocations")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/net/ethernet/sgi/ioc3-eth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
index 477af82bf8a9..8a684d882e63 100644
--- a/drivers/net/ethernet/sgi/ioc3-eth.c
+++ b/drivers/net/ethernet/sgi/ioc3-eth.c
@@ -1243,7 +1243,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	/* Allocate rx ring.  4kb = 512 entries, must be 4kb aligned */
 	ip->rxr = dma_alloc_coherent(ip->dma_dev, RX_RING_SIZE, &ip->rxr_dma,
-				     GFP_ATOMIC);
+				     GFP_KERNEL);
 	if (!ip->rxr) {
 		pr_err("ioc3-eth: rx ring allocation failed\n");
 		err = -ENOMEM;
@@ -1252,7 +1252,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	/* Allocate tx rings.  16kb = 128 bufs, must be 16kb aligned  */
 	ip->txr = dma_alloc_coherent(ip->dma_dev, TX_RING_SIZE, &ip->txr_dma,
-				     GFP_KERNEL | __GFP_ZERO);
+				     GFP_KERNEL);
 	if (!ip->txr) {
 		pr_err("ioc3-eth: tx ring allocation failed\n");
 		err = -ENOMEM;
-- 
2.20.1


  parent reply	other threads:[~2019-10-30 21:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30 21:12 ioc3_eth DMA API fixes Christoph Hellwig
2019-10-30 21:12 ` [PATCH 1/4] net: sgi: ioc3-eth: don't abuse dma_direct_* calls Christoph Hellwig
2019-10-30 22:05   ` Thomas Bogendoerfer
2019-10-30 22:38     ` Christoph Hellwig
2019-10-31  8:54       ` Thomas Bogendoerfer
2019-10-31 13:15         ` Christoph Hellwig
2019-10-31 15:18           ` Thomas Bogendoerfer
2019-10-31 17:01             ` Christoph Hellwig
2019-10-31 19:15             ` David Miller
2019-10-30 21:12 ` Christoph Hellwig [this message]
2019-10-30 21:12 ` [PATCH 3/4] net: sgi: ioc3-eth: simplify setting the DMA mask Christoph Hellwig
2019-10-30 21:12 ` [PATCH 4/4] net: sgi: ioc3-eth: fix setting NETIF_F_HIGHDMA Christoph Hellwig
2019-10-31 21:13 ` ioc3_eth DMA API fixes David Miller
2019-10-31 21:23   ` Christoph Hellwig

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=20191030211233.30157-3-hch@lst.de \
    --to=hch@lst.de \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tbogendoerfer@suse.de \
    /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).