Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: mptctl: Remove unneeded cast from memory allocation

Remove casting the values returned by memory allocation function.

Coccinelle emits WARNING:

./drivers/message/fusion/mptctl.c:2596:14-31: WARNING: casting value returned by memory allocation function to (SCSIDevicePage0_t *) is useless.
./drivers/message/fusion/mptctl.c:2660:15-32: WARNING: casting value returned by memory allocation function to (SCSIDevicePage3_t *) is useless.

Link: https://lore.kernel.org/r/1596014390-18605-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>

authored by

Li Heng and committed by
Martin K. Petersen
8fee79ed 33fff97c

+2 -3
+2 -3
drivers/message/fusion/mptctl.c
··· 2593 2593 /* Get the data transfer speeds 2594 2594 */ 2595 2595 data_sz = ioc->spi_data.sdp0length * 4; 2596 - pg0_alloc = (SCSIDevicePage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma); 2596 + pg0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma); 2597 2597 if (pg0_alloc) { 2598 2598 hdr.PageVersion = ioc->spi_data.sdp0version; 2599 2599 hdr.PageLength = data_sz; ··· 2657 2657 /* Issue the second config page request */ 2658 2658 cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; 2659 2659 data_sz = (int) cfg.cfghdr.hdr->PageLength * 4; 2660 - pg3_alloc = (SCSIDevicePage3_t *) pci_alloc_consistent( 2661 - ioc->pcidev, data_sz, &page_dma); 2660 + pg3_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma); 2662 2661 if (pg3_alloc) { 2663 2662 cfg.physAddr = page_dma; 2664 2663 cfg.pageAddr = (karg.hdr.channel << 8) | karg.hdr.id;