]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: sgi: ioc3-eth: fix usage of GFP_* flags
authorChristoph Hellwig <hch@lst.de>
Mon, 4 Nov 2019 10:45:12 +0000 (11:45 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Nov 2019 19:30:14 +0000 (11:30 -0800)
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>
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sgi/ioc3-eth.c

index 477af82bf8a99e6271d6a67dbaad0bde0ef017d5..8a684d882e639a5824fd861c46ddb6a011a4b52c 100644 (file)
@@ -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;