* [PATCH] scsi: mpi3mr: Remove useless casting value returned by kcalloc to structure
@ 2022-09-12 21:29 Jules Irenge
0 siblings, 0 replies; only message in thread
From: Jules Irenge @ 2022-09-12 21:29 UTC (permalink / raw)
To: jejb; +Cc: martin.petersen, linux-kernel, linux-scsi, mpi3mr-linuxdrv.pdl
coccinelle reports a warning
WARNING: casting value returned by memory allocation function
to (struct mpi3mr_throttle_group_info *) is useless
To fix this the useless cast is removed.
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
drivers/scsi/mpi3mr/mpi3mr_fw.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index 0866dfd43318..ee3c695ece9a 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -3795,8 +3795,7 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc)
if (!mrioc->throttle_groups && mrioc->num_io_throttle_group) {
dprint_init(mrioc, "allocating memory for throttle groups\n");
sz = sizeof(struct mpi3mr_throttle_group_info);
- mrioc->throttle_groups = (struct mpi3mr_throttle_group_info *)
- kcalloc(mrioc->num_io_throttle_group, sz, GFP_KERNEL);
+ mrioc->throttle_groups = kcalloc(mrioc->num_io_throttle_group, sz, GFP_KERNEL);
if (!mrioc->throttle_groups)
goto out_failed_noretry;
}
--
2.35.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-12 21:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 21:29 [PATCH] scsi: mpi3mr: Remove useless casting value returned by kcalloc to structure Jules Irenge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®