Skip to contentSkip to conversation

message: fusion: delete the useless casting value returned

PATCH Applied Wang Qing 2 participants 2 messages Mar 12, 2021 – Mar 30, 2021

Subsystems (2)
lore
Share & tools
lore

Wang Qing

author
#0 lore raw

PATCH 1/1 message: fusion: delete the useless casting value returned

Fix the following coccicheck warning:
WARNING: casting value returned by memory allocation function is useless.

---
 drivers/message/fusion/mptbase.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/message/fusion/mptbase.c +3 -3
index 549797d..fa9b122
@@ -4974,7 +4974,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);
@@ -5020,7 +5020,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc)
 
 	data_sz = hdr.PageLength * 4;
 	rc = -ENOMEM;
-	ppage1_alloc = (LANPage1_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page1_dma);
+	ppage1_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page1_dma);
 	if (ppage1_alloc) {
 		memset((u8 *)ppage1_alloc, 0, data_sz);
 		cfg.physAddr = page1_dma;
@@ -5321,7 +5321,7 @@ GetIoUnitPage2(MPT_ADAPTER *ioc)
 	/* Read the config page */
 	data_sz = hdr.PageLength * 4;
 	rc = -ENOMEM;
-	ppage_alloc = (IOUnitPage2_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
+	ppage_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
 	if (ppage_alloc) {
 		memset((u8 *)ppage_alloc, 0, data_sz);
 		cfg.physAddr = page_dma;
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Wang Qing

Fix the following coccicheck warning:
WARNING: casting value returned by memory allocation function is useless.

Applied to 5.13/scsi-queue, thanks!

[1/1] message: fusion: delete the useless casting value returned

      https://git.kernel.org/mkp/scsi/c/690209d5ebef
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering