From: Joe Perches <joe@perches.com>
To: Alex Dewar <alex.dewar90@gmail.com>,
Sathya Prakash <sathya.prakash@broadcom.com>,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: mptfusion: Remove unnecessarily casts
Date: Thu, 20 Aug 2020 11:53:58 -0700 [thread overview]
Message-ID: <a99fde707b367b0cee126b596b2dc7a74dbb84e7.camel@perches.com> (raw)
In-Reply-To: <20200820180552.853289-1-alex.dewar90@gmail.com>
On Thu, 2020-08-20 at 19:05 +0100, Alex Dewar wrote:
> In a number of places, the value returned from pci_alloc_consistent() is
> unnecessarily cast from void*. Remove these casts.
[]
> diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
[]
> @@ -4975,7 +4975,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc)
>
> if (hdr.PageLength > 0) {
> data_sz = hdr.PageLength * 4;
> - ppage0_alloc = (LANPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
> + ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
> rc = -ENOMEM;
> if (ppage0_alloc) {
> memset((u8 *)ppage0_alloc, 0, data_sz);
If you are removing unnecessary casts, it'd be better to remove
all of them in the same file or subsystem at once.
Also this memset and cast isn't actually necessary any more
as pci_alloc_consistent already zeros memory.
etc...
next prev parent reply other threads:[~2020-08-20 18:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 18:05 [PATCH] scsi: mptfusion: Remove unnecessarily casts Alex Dewar
2020-08-20 18:53 ` Joe Perches [this message]
2020-08-20 18:56 ` Alex Dewar
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=a99fde707b367b0cee126b596b2dc7a74dbb84e7.camel@perches.com \
--to=joe@perches.com \
--cc=MPT-FusionLinux.pdl@broadcom.com \
--cc=alex.dewar90@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
--cc=suganath-prabu.subramani@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