Skip to contentSkip to conversation

net: sun: Remove unneeded cast from memory allocation

PATCH Applied Aishwarya Ramakrishnan 2 participants 2 messages Apr 19, 2020 – Apr 20, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: sun: Remove unneeded cast from memory allocation

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.

---
 drivers/net/ethernet/sun/cassini.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/sun/cassini.c +1 -1
index e6d1aa882fa5..3ee6ab104cb9 100644
@@ -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) {
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

From: Aishwarya Ramakrishnan <[email protected]>
Date: Sun, 19 Apr 2020 21:14:43 +0530

Quoted 8 lines

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.

Applied to net-next, thanks.