mirror of https://gitee.com/openkylin/linux.git
scsi: mptfc: Remove unneeded cast from memory allocation
Remove casting the values returned by memory allocation function. Coccinelle emits WARNING: ./drivers/message/fusion/mptfc.c:766:17-30: WARNING: casting value returned by memory allocation function to (FCPortPage0_t *) is useless. ./drivers/message/fusion/mptfc.c:907:17-30: WARNING: casting value returned by memory allocation function to (FCPortPage1_t *) is useless. [mkp: memset()] Link: https://lore.kernel.org/r/1596014354-59935-1-git-send-email-liheng40@huawei.com Signed-off-by: Li Heng <liheng40@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
460d74a091
commit
33fff97cbd
|
@ -763,7 +763,7 @@ mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
|
||||||
|
|
||||||
data_sz = hdr.PageLength * 4;
|
data_sz = hdr.PageLength * 4;
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
|
ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
|
||||||
if (ppage0_alloc) {
|
if (ppage0_alloc) {
|
||||||
|
|
||||||
try_again:
|
try_again:
|
||||||
|
@ -904,7 +904,7 @@ mptfc_GetFcPortPage1(MPT_ADAPTER *ioc, int portnum)
|
||||||
if (data_sz < sizeof(FCPortPage1_t))
|
if (data_sz < sizeof(FCPortPage1_t))
|
||||||
data_sz = sizeof(FCPortPage1_t);
|
data_sz = sizeof(FCPortPage1_t);
|
||||||
|
|
||||||
page1_alloc = (FCPortPage1_t *) pci_alloc_consistent(ioc->pcidev,
|
page1_alloc = pci_alloc_consistent(ioc->pcidev,
|
||||||
data_sz,
|
data_sz,
|
||||||
&page1_dma);
|
&page1_dma);
|
||||||
if (!page1_alloc)
|
if (!page1_alloc)
|
||||||
|
@ -922,8 +922,6 @@ mptfc_GetFcPortPage1(MPT_ADAPTER *ioc, int portnum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(page1_alloc,0,data_sz);
|
|
||||||
|
|
||||||
cfg.physAddr = page1_dma;
|
cfg.physAddr = page1_dma;
|
||||||
cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
|
cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue