lkml.org 
[lkml]   [2020]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] scsi: mptfusion: Remove unnecessarily casts
From
Date
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...

\
 
 \ /
  Last update: 2020-08-20 20:54    [W:0.035 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site