]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: sun: Remove unneeded cast from memory allocation
authorAishwarya Ramakrishnan <aishwaryarj100@gmail.com>
Sun, 19 Apr 2020 15:44:43 +0000 (21:14 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Apr 2020 19:21:21 +0000 (12:21 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sun/cassini.c

index e6d1aa882fa5b116b224ce9c801664954d075f36..3ee6ab104cb98fda886cbeff2376f2dbe2e19986 100644 (file)
@@ -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) {