Blame SOURCES/0012-netdrv-cross-tree-phase-out-dma_zalloc_coherent.patch

f95c89
From 10271656a2cca09a8fc023e78559156fb0659583 Mon Sep 17 00:00:00 2001
f95c89
From: Jonathan Toppins <jtoppins@redhat.com>
f95c89
Date: Wed, 2 Oct 2019 18:22:26 -0400
f95c89
Subject: [PATCH 12/96] [netdrv] cross-tree: phase out dma_zalloc_coherent()
f95c89
f95c89
Message-id: <239a788461171e2df3655e35be52674e381012f6.1570027456.git.jtoppins@redhat.com>
f95c89
Patchwork-id: 276430
f95c89
O-Subject: [RHEL-8.2 PATCH 04/78] cross-tree: phase out dma_zalloc_coherent()
f95c89
Bugzilla: 1724766
f95c89
RH-Acked-by: Don Dutile <ddutile@redhat.com>
f95c89
RH-Acked-by: John Linville <linville@redhat.com>
f95c89
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
f95c89
f95c89
We already need to zero out memory for dma_alloc_coherent(), as such
f95c89
using dma_zalloc_coherent() is superflous. Phase it out.
f95c89
f95c89
This change was generated with the following Coccinelle SmPL patch:
f95c89
f95c89
@ replace_dma_zalloc_coherent @
f95c89
expression dev, size, data, handle, flags;
f95c89
@@
f95c89
f95c89
-dma_zalloc_coherent(dev, size, handle, flags)
f95c89
+dma_alloc_coherent(dev, size, handle, flags)
f95c89
f95c89
Suggested-by: Christoph Hellwig <hch@lst.de>
f95c89
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
f95c89
[hch: re-ran the script on the latest tree]
f95c89
Signed-off-by: Christoph Hellwig <hch@lst.de>
f95c89
(cherry picked from commit 750afb08ca71310fcf0c4e2cb1565c63b8235b60)
f95c89
f95c89
Note: only applied bnxt_en/bnxt_re applicable hunks.
f95c89
Bugzilla: 1724766
f95c89
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=23809532
f95c89
Tested: build, boot, basic ping
f95c89
f95c89
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
f95c89
Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
f95c89
---
f95c89
 drivers/net/ethernet/broadcom/bnxt/bnxt.c         | 16 ++++++++--------
f95c89
 drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c     |  4 ++--
f95c89
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c |  4 ++--
f95c89
 3 files changed, 12 insertions(+), 12 deletions(-)
f95c89
f95c89
Index: src/drivers/net/ethernet/broadcom/bnxt/bnxt.c
f95c89
===================================================================
f95c89
--- src.orig/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-02-06 16:23:12.151545820 +0100
f95c89
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-02-06 16:23:12.276544673 +0100
f95c89
@@ -3476,10 +3476,10 @@
f95c89
 			goto alloc_tx_ext_stats;
f95c89
 
f95c89
 		bp->hw_rx_port_stats_ext =
f95c89
-			dma_zalloc_coherent(&pdev->dev,
f95c89
-					    sizeof(struct rx_port_stats_ext),
f95c89
-					    &bp->hw_rx_port_stats_ext_map,
f95c89
-					    GFP_KERNEL);
f95c89
+			dma_alloc_coherent(&pdev->dev,
f95c89
+					   sizeof(struct rx_port_stats_ext),
f95c89
+					   &bp->hw_rx_port_stats_ext_map,
f95c89
+					   GFP_KERNEL);
f95c89
 		if (!bp->hw_rx_port_stats_ext)
f95c89
 			return 0;
f95c89
 
f95c89
@@ -3489,10 +3489,10 @@
f95c89
 
f95c89
 		if (bp->hwrm_spec_code >= 0x10902) {
f95c89
 			bp->hw_tx_port_stats_ext =
f95c89
-				dma_zalloc_coherent(&pdev->dev,
f95c89
-					    sizeof(struct tx_port_stats_ext),
f95c89
-					    &bp->hw_tx_port_stats_ext_map,
f95c89
-					    GFP_KERNEL);
f95c89
+				dma_alloc_coherent(&pdev->dev,
f95c89
+						   sizeof(struct tx_port_stats_ext),
f95c89
+						   &bp->hw_tx_port_stats_ext_map,
f95c89
+						   GFP_KERNEL);
f95c89
 		}
f95c89
 		bp->flags |= BNXT_FLAG_PORT_STATS_EXT;
f95c89
 	}
f95c89
Index: src/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
f95c89
===================================================================
f95c89
--- src.orig/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c	2020-02-06 16:22:57.132683682 +0100
f95c89
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c	2020-02-06 16:23:12.277544664 +0100
f95c89
@@ -316,8 +316,8 @@
f95c89
 
f95c89
 	n = IEEE_8021QAZ_MAX_TCS;
f95c89
 	data_len = sizeof(*data) + sizeof(*fw_app) * n;
f95c89
-	data = dma_zalloc_coherent(&bp->pdev->dev, data_len, &mapping,
f95c89
-				   GFP_KERNEL);
f95c89
+	data = dma_alloc_coherent(&bp->pdev->dev, data_len, &mapping,
f95c89
+				  GFP_KERNEL);
f95c89
 	if (!data)
f95c89
 		return -ENOMEM;
f95c89
 
f95c89
Index: src/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
f95c89
===================================================================
f95c89
--- src.orig/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c	2020-02-06 16:23:11.781549217 +0100
f95c89
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c	2020-02-06 16:23:12.277544664 +0100
f95c89
@@ -86,8 +86,8 @@
f95c89
 		return -EFAULT;
f95c89
 	}
f95c89
 
f95c89
-	data_addr = dma_zalloc_coherent(&bp->pdev->dev, bytesize,
f95c89
-					&data_dma_addr, GFP_KERNEL);
f95c89
+	data_addr = dma_alloc_coherent(&bp->pdev->dev, bytesize,
f95c89
+				       &data_dma_addr, GFP_KERNEL);
f95c89
 	if (!data_addr)
f95c89
 		return -ENOMEM;
f95c89