Skip to contentSkip to conversation

scsi: mptfusion: remove redundant variable r

PATCH Applied Colin Ian King 2 participants 3 messages Dec 5, 2021 – Dec 14, 2021

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

PATCH 1/1 scsi: mptfusion: remove redundant variable r

Variable r is being assigned a value that is never read. The assignment is redundant and so is the variable, so remove these. Remove unnecessary the {} braces in the if statement too.

---
 drivers/message/fusion/mptbase.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/message/fusion/mptbase.c +2 -4
index b94d5e4fdc23..24a4532053e4 100644
@@ -1274,8 +1274,6 @@ mpt_send_handshake_request(u8 cb_idx, MPT_ADAPTER *ioc, int reqBytes, u32 *req,
 static int
 mpt_host_page_access_control(MPT_ADAPTER *ioc, u8 access_control_value, int sleepFlag)
 {
-	int	 r = 0;
-
 	/* return if in use */
 	if (CHIPREG_READ32(&ioc->chip->Doorbell)
 	    & MPI_DOORBELL_ACTIVE)
@@ -1289,9 +1287,9 @@ mpt_host_page_access_control(MPT_ADAPTER *ioc, u8 access_control_value, int slee
 		 (access_control_value<<12)));
 
 	/* Wait for IOC to clear Doorbell Status bit */
-	if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) {
+	if (WaitForDoorbellAck(ioc, 5, sleepFlag) < 0)
 		return -2;
-	}else
+	else
 		return 0;
 }
 
Signature · 1 line
2.33.1
#1 lore raw

Colin,

Quoted 3 lines

Variable r is being assigned a value that is never read. The assignment is redundant and so is the variable, so remove these. Remove unnecessary the {} braces in the if statement too.

Applied to 5.17/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#2 lore raw
In reply to Colin Ian King
Quoted 5 lines · Colin Ian King

Variable r is being assigned a value that is never read. The assignment is redundant and so is the variable, so remove these. Remove unnecessary the {} braces in the if statement too.

Applied to 5.17/scsi-queue, thanks!

[1/1] scsi: mptfusion: remove redundant variable r

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