public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: be2iscsi: Remove redundant initialization
@ 2021-05-13 22:20 Nigel Christian
  2021-05-22  4:41 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Nigel Christian @ 2021-05-13 22:20 UTC (permalink / raw)
  To: Martin K. Petersen, James E.J. Bottomley; +Cc: linux-scsi, kernel-janitors

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")
Signed-off-by: Nigel Christian <nigel.l.christian@gmail.com>
---
 drivers/scsi/be2iscsi/be_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 22cf7f4b8d8c..c15cc6c164d9 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -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,
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: be2iscsi: Remove redundant initialization
  2021-05-13 22:20 [PATCH] scsi: be2iscsi: Remove redundant initialization Nigel Christian
@ 2021-05-22  4:41 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2021-05-22  4:41 UTC (permalink / raw)
  To: James E.J. Bottomley, Nigel Christian
  Cc: Martin K . Petersen, linux-scsi, kernel-janitors

On Thu, 13 May 2021 17:20:32 -0500, Nigel Christian wrote:

> 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

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-22  4:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-13 22:20 [PATCH] scsi: be2iscsi: Remove redundant initialization Nigel Christian
2021-05-22  4:41 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox