linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: sungem: Remove unneeded cast from memory allocation
@ 2020-09-01 14:10 YueHaibing
  2020-09-01 18:49 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2020-09-01 14:10 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, YueHaibing

Remove dma_alloc_coherent return value cast.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/ethernet/sun/sungem.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index eeb8518c8a84..b7093975b14c 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -2965,9 +2965,8 @@ static int gem_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	/* It is guaranteed that the returned buffer will be at least
 	 * PAGE_SIZE aligned.
 	 */
-	gp->init_block = (struct gem_init_block *)
-		dma_alloc_coherent(&pdev->dev, sizeof(struct gem_init_block),
-				   &gp->gblock_dvma, GFP_KERNEL);
+	gp->init_block = dma_alloc_coherent(&pdev->dev, sizeof(struct gem_init_block),
+					    &gp->gblock_dvma, GFP_KERNEL);
 	if (!gp->init_block) {
 		pr_err("Cannot allocate init block, aborting\n");
 		err = -ENOMEM;
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: sungem: Remove unneeded cast from memory allocation
  2020-09-01 14:10 [PATCH net-next] net: sungem: Remove unneeded cast from memory allocation YueHaibing
@ 2020-09-01 18:49 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-09-01 18:49 UTC (permalink / raw)
  To: yuehaibing; +Cc: kuba, netdev, linux-kernel

From: YueHaibing <yuehaibing@huawei.com>
Date: Tue, 1 Sep 2020 22:10:28 +0800

> Remove dma_alloc_coherent return value cast.
> This is detected by coccinelle.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-01 18:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01 14:10 [PATCH net-next] net: sungem: Remove unneeded cast from memory allocation YueHaibing
2020-09-01 18:49 ` David Miller

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).