Skip to contentSkip to conversation

scsi: ibmvscsi: delete the useless casting value returned

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

Subsystems (3)
lore
Share & tools
lore

Wang Qing

author
#0 lore raw

PATCH 1/1 scsi: ibmvscsi: delete the useless casting value returned

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

---
 drivers/scsi/ibmvscsi/ibmvscsi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/ibmvscsi/ibmvscsi.c +1 -2
index 29fcc44..f084ca10
@@ -717,8 +717,7 @@ static int map_sg_data(struct scsi_cmnd *cmd,
 
 	/* get indirect table */
 	if (!evt_struct->ext_list) {
-		evt_struct->ext_list = (struct srp_direct_buf *)
-			dma_alloc_coherent(dev,
+		evt_struct->ext_list = dma_alloc_coherent(dev,
 					   SG_ALL * sizeof(struct srp_direct_buf),
 					   &evt_struct->ext_list_token, 0);
 		if (!evt_struct->ext_list) {
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] scsi: ibmvscsi: delete the useless casting value returned

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