Skip to contentSkip to conversation

scsi: be2iscsi: Remove redundant initialization

PATCH Applied Nigel Christian 2 participants 2 messages May 13, 2021 – May 22, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: be2iscsi: Remove redundant initialization

The nested for loop variables i and j in beiscsi_free_mem() are initialized twice. The values outside of the loops are redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/scsi/be2iscsi/be_main.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/be2iscsi/be_main.c +0 -2
index 22cf7f4b8d8c..c15cc6c164d9 100644
@@ -3858,8 +3858,6 @@ static void beiscsi_free_mem(struct beiscsi_hba *phba)
 	int i, j;
 
 	mem_descr = phba->init_mem;
-	i = 0;
-	j = 0;
 	for (i = 0; i < SE_MEM_MAX; i++) {
 		for (j = mem_descr->num_elements; j > 0; j--) {
 			dma_free_coherent(&phba->pcidev->dev,
Signature · 1 line
2.31.1
#1 lore raw
Quoted 3 lines · Nigel Christian

The nested for loop variables i and j in beiscsi_free_mem() are initialized twice. The values outside of the loops are redundant and can be removed.

Applied to 5.14/scsi-queue, thanks!

[1/1] scsi: be2iscsi: Remove redundant initialization

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