All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: sun: Remove unneeded cast from memory allocation
@ 2020-04-19 15:44 Aishwarya Ramakrishnan
  2020-04-20 19:21 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Aishwarya Ramakrishnan @ 2020-04-19 15:44 UTC (permalink / raw)
  To: David S. Miller, Heiner Kallweit, Jakub Kicinski,
	Michael S. Tsirkin, Martin Habets, Aishwarya Ramakrishnan,
	Jonathan Lemon, netdev, linux-kernel

Remove casting the values returned by memory allocation function.

Coccinelle emits WARNING: casting value returned by memory allocation
function to (struct cas_init_block *) is useless.

This issue was detected by using the Coccinelle software.

Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
---
 drivers/net/ethernet/sun/cassini.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
index e6d1aa882fa5..3ee6ab104cb9 100644
--- a/drivers/net/ethernet/sun/cassini.c
+++ b/drivers/net/ethernet/sun/cassini.c
@@ -5059,7 +5059,7 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (cp->cas_flags & CAS_FLAG_SATURN)
 		cas_saturn_firmware_init(cp);
 
-	cp->init_block = (struct cas_init_block *)
+	cp->init_block =
 		pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
 				     &cp->block_dvma);
 	if (!cp->init_block) {
-- 
2.17.1


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

* Re: [PATCH] net: sun: Remove unneeded cast from memory allocation
  2020-04-19 15:44 [PATCH] net: sun: Remove unneeded cast from memory allocation Aishwarya Ramakrishnan
@ 2020-04-20 19:21 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-04-20 19:21 UTC (permalink / raw)
  To: aishwaryarj100
  Cc: hkallweit1, kuba, mst, mhabets, jonathan.lemon, netdev, linux-kernel

From: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
Date: Sun, 19 Apr 2020 21:14:43 +0530

> Remove casting the values returned by memory allocation function.
> 
> Coccinelle emits WARNING: casting value returned by memory allocation
> function to (struct cas_init_block *) is useless.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>

Applied to net-next, thanks.

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

end of thread, other threads:[~2020-04-20 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-19 15:44 [PATCH] net: sun: Remove unneeded cast from memory allocation Aishwarya Ramakrishnan
2020-04-20 19:21 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.