* [PATCH] Scsi: lpfc: lpfc_init: Remove useless casting value
@ 2014-03-12 21:20 Matei Oprea
2014-03-12 21:35 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Matei Oprea @ 2014-03-12 21:20 UTC (permalink / raw)
To: JBottomley; +Cc: linux-scsi, linux-kernel, Matei Oprea, ROSEdu Kernel Community
Remove useless casting value returned by k[cmz]alloc
to (struct lpfc_sli_ring *).
Found using coccinelle
Signed-off-by: Matei Oprea <eu@opreamatei.ro>
Cc: ROSEdu Kernel Community <firefly@lists.rosedu.org>
---
drivers/scsi/lpfc/lpfc_init.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 68c94cc..47d2c20 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -4731,8 +4731,7 @@ lpfc_sli_driver_resource_setup(struct lpfc_hba *phba)
}
if (!phba->sli.ring)
- phba->sli.ring = (struct lpfc_sli_ring *)
- kzalloc(LPFC_SLI3_MAX_RING *
+ phba->sli.ring = kzalloc(LPFC_SLI3_MAX_RING *
sizeof(struct lpfc_sli_ring), GFP_KERNEL);
if (!phba->sli.ring)
return -ENOMEM;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Scsi: lpfc: lpfc_init: Remove useless casting value
2014-03-12 21:20 [PATCH] Scsi: lpfc: lpfc_init: Remove useless casting value Matei Oprea
@ 2014-03-12 21:35 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2014-03-12 21:35 UTC (permalink / raw)
To: Matei Oprea; +Cc: JBottomley, linux-scsi, linux-kernel, ROSEdu Kernel Community
On Wed, 2014-03-12 at 23:20 +0200, Matei Oprea wrote:
> Remove useless casting value returned by k[cmz]alloc
> to (struct lpfc_sli_ring *).
>
> Found using coccinelle
trivial note:
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
[]
> @@ -4731,8 +4731,7 @@ lpfc_sli_driver_resource_setup(struct lpfc_hba *phba)
[]
> - phba->sli.ring = (struct lpfc_sli_ring *)
> - kzalloc(LPFC_SLI3_MAX_RING *
> + phba->sli.ring = kzalloc(LPFC_SLI3_MAX_RING *
> sizeof(struct lpfc_sli_ring), GFP_KERNEL);
Using kcalloc would have been even nicer too
phba->sli.ring = kcalloc(LPFC_SLI3_MAX_RING,
sizeof(struct lpfc_sli_ring),
GFP_KERNEL);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-03-12 21:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-12 21:20 [PATCH] Scsi: lpfc: lpfc_init: Remove useless casting value Matei Oprea
2014-03-12 21:35 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox