Skip to content

Commit

Permalink
net: sun: Remove unneeded cast from memory allocation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aishwarya Ramakrishnan authored and David S. Miller committed Apr 20, 2020
1 parent 92efe48 commit 5333fdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/sun/cassini.c
Original file line number Diff line number Diff line change
@@ -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) {

0 comments on commit 5333fdb

Please sign in to comment.