Skip to contentSkip to conversation

scsi: mptscsih: remove set but not used 'timeleft'

PATCH Applied Jason Yan 2 participants 2 messages Aug 27, 2020 – Sep 9, 2020

Subsystems (2)
lore
Share & tools
lore

Jason Yan

author
#0 lore raw

PATCH 1/1 scsi: mptscsih: remove set but not used 'timeleft'

This addresses the following gcc warning with "make W=1":

drivers/message/fusion/mptscsih.c: In function ‘mptscsih_IssueTaskMgmt’:
drivers/message/fusion/mptscsih.c:1519:17: warning: variable ‘timeleft’ set but not used [-Wunused-but-set-variable]

 1519 |  unsigned long  timeleft;
      |                 ^~~~~~~~
---
 drivers/message/fusion/mptscsih.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/message/fusion/mptscsih.c +1 -2
index 8543f0324d5a..a5ef9faf71c7 100644
@@ -1516,7 +1516,6 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, u64 lun,
 	int		 ii;
 	int		 retval;
 	MPT_ADAPTER 	*ioc = hd->ioc;
-	unsigned long	 timeleft;
 	u8		 issue_hard_reset;
 	u32		 ioc_raw_state;
 	unsigned long	 time_count;
@@ -1614,7 +1613,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, u64 lun,
 		}
 	}
 
-	timeleft = wait_for_completion_timeout(&ioc->taskmgmt_cmds.done,
+	wait_for_completion_timeout(&ioc->taskmgmt_cmds.done,
 		timeout*HZ);
 	if (!(ioc->taskmgmt_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD)) {
 		retval = FAILED;
Signature · 1 line
2.25.4
#1 lore raw
Quoted 7 lines · Jason Yan

This addresses the following gcc warning with "make W=1":

drivers/message/fusion/mptscsih.c: In function ‘mptscsih_IssueTaskMgmt’:
drivers/message/fusion/mptscsih.c:1519:17: warning: variable ‘timeleft’ set but not used [-Wunused-but-set-variable]

 1519 |  unsigned long  timeleft;
      |                 ^~~~~~~~

Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: mptscsih: Remove set but not used 'timeleft'

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