diff mbox series

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

Message ID 20200827125925.428357-1-yanaijie@huawei.com (mailing list archive)
State Accepted
Headers show
Series scsi: mptscsih: remove set but not used 'timeleft' | expand

Commit Message

Jason Yan Aug. 27, 2020, 12:59 p.m. UTC
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;
      |                 ^~~~~~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 drivers/message/fusion/mptscsih.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Martin K. Petersen Sept. 9, 2020, 2:09 a.m. UTC | #1
On Thu, 27 Aug 2020 20:59:25 +0800, Jason Yan wrote:

> 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
diff mbox series

Patch

diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 8543f0324d5a..a5ef9faf71c7 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -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;