Skip to contentSkip to conversation

scsi: esas2r: Remove unnecessary casts

PATCH Applied Alex Dewar 2 participants 2 messages Aug 20, 2020 – Aug 31, 2020

Subsystems (2)
lore
Share & tools
lore

Alex Dewar

author
#0 lore raw

PATCH 1/1 scsi: esas2r: Remove unnecessary casts

In a number of places in esas2r_ioctl.c, the void* returned from pci_alloc_consistent() is cast unnecessarily. Remove casts.

Issue identified with Coccinelle.

---
 drivers/scsi/esas2r/esas2r_ioctl.c | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)
drivers/scsi/esas2r/esas2r_ioctl.c +13 -15
index cc620f10eabc..08f4e43c7d9e 100644
@@ -1548,11 +1548,10 @@ static int allocate_fw_buffers(struct esas2r_adapter *a, u32 length)
 
 	a->firmware.orig_len = length;
 
-	a->firmware.data = (u8 *)dma_alloc_coherent(&a->pcid->dev,
-						    (size_t)length,
-						    (dma_addr_t *)&a->firmware.
-						    phys,
-						    GFP_KERNEL);
+	a->firmware.data = dma_alloc_coherent(&a->pcid->dev,
+					      (size_t)length,
+					      (dma_addr_t *)&a->firmware.phys,
+					      GFP_KERNEL);
 
 	if (!a->firmware.data) {
 		esas2r_debug("buffer alloc failed!");
@@ -1895,11 +1894,11 @@ int esas2r_write_vda(struct esas2r_adapter *a, const char *buf, long off,
 
 	if (!a->vda_buffer) {
 		dma_addr_t dma_addr;
-		a->vda_buffer = (u8 *)dma_alloc_coherent(&a->pcid->dev,
-							 (size_t)
-							 VDA_MAX_BUFFER_SIZE,
-							 &dma_addr,
-							 GFP_KERNEL);
+		a->vda_buffer = dma_alloc_coherent(&a->pcid->dev,
+						   (size_t)
+						   VDA_MAX_BUFFER_SIZE,
+						   &dma_addr,
+						   GFP_KERNEL);
 
 		a->ppvda_buffer = dma_addr;
 	}
@@ -2064,11 +2063,10 @@ int esas2r_write_fs(struct esas2r_adapter *a, const char *buf, long off,
 re_allocate_buffer:
 			a->fs_api_buffer_size = length;
 
-			a->fs_api_buffer = (u8 *)dma_alloc_coherent(
-				&a->pcid->dev,
-				(size_t)a->fs_api_buffer_size,
-				(dma_addr_t *)&a->ppfs_api_buffer,
-				GFP_KERNEL);
+			a->fs_api_buffer = dma_alloc_coherent(&a->pcid->dev,
+							      (size_t)a->fs_api_buffer_size,
+							      (dma_addr_t *)&a->ppfs_api_buffer,
+							      GFP_KERNEL);
 		}
 	}
 
Signature · 1 line
2.28.0
#1 lore raw
Quoted 4 lines · Alex Dewar

In a number of places in esas2r_ioctl.c, the void* returned from pci_alloc_consistent() is cast unnecessarily. Remove casts.

Issue identified with Coccinelle.

Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: esas2r: Remove unnecessary casts

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