From: Jules Irenge <jbi.octave@gmail.com>
To: jejb@linux.ibm.com
Cc: martin.petersen@oracle.com, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org, mpi3mr-linuxdrv.pdl@broadcom.com
Subject: [PATCH] scsi: mpi3mr: Remove useless casting value returned by kcalloc to structure
Date: Mon, 12 Sep 2022 22:29:11 +0100 [thread overview]
Message-ID: <Yx+kp8NxHvDHs7dv@playground> (raw)
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
reply other threads:[~2022-09-12 21:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yx+kp8NxHvDHs7dv@playground \
--to=jbi.octave@gmail.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mpi3mr-linuxdrv.pdl@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®