scsi: message: fusion: remove unused timeleft variable
Subsystems (2)
PATCH 1/1 scsi: message: fusion: remove unused timeleft variable
clang with W=1 reports drivers/message/fusion/mptsas.c:4796:17: error: variable
'timeleft' set but not used [-Werror,-Wunused-but-set-variable]
unsigned long timeleft;
^This variable is not used so remove it.
--- drivers/message/fusion/mptsas.c | 3 --- 1 file changed, 3 deletions(-)
drivers/message/fusion/mptsas.c +0 -3
@@ -4793,7 +4793,6 @@ mptsas_issue_tm(MPT_ADAPTER *ioc, u8 type, u8 channel, u8 id, u64 lun,MPT_FRAME_HDR *mf;SCSITaskMgmt_t *pScsiTm;int retval; -unsigned long timeleft; *issue_reset =0 ; mf =mpt_get_msg_frame (mptsasDeviceResetCtx, ioc);
@@ -4829,8 +4828,6 @@ mptsas_issue_tm(MPT_ADAPTER *ioc, u8 type, u8 channel, u8 id, u64 lun,mpt_put_msg_frame_hi_pri (mptsasDeviceResetCtx, ioc, mf);/* Now wait for the command to complete */ - timeleft =wait_for_completion_timeout (&ioc->taskmgmt_cmds.done, - timeout*HZ );if (!(ioc->taskmgmt_cmds.status &MPT_MGMT_STATUS_COMMAND_GOOD )) { retval =-1 ;/* return failure */ dtmprintk(ioc, printk(MYIOC_s_ERR_FMT
Signature · 1 line
2.27.0
Quoted 26 lines · Tom Rix
clang with W=1 reports
drivers/message/fusion/mptsas.c:4796:17: error: variable
'timeleft' set but not used [-Werror,-Wunused-but-set-variable]unsigned long timeleft; ^This variable is not used so remove it.
Signed-off-by Tom Rix <[email protected]>--- drivers/message/fusion/mptsas.c | 3 --- 1 file changed, 3 deletions(-)drivers/message/fusion/mptsas.c +0
-1@@ -4793,7 +4793,6 @@ mptsas_issue_tm(MPT_ADAPTER *ioc, u8 type, u8 channel, u8 id, u64 lun,MPT_FRAME_HDR *mf;SCSITaskMgmt_t *pScsiTm;int retval; -unsigned long timeleft; *issue_reset =0 ; mf =mpt_get_msg_frame (mptsasDeviceResetCtx, ioc);
drivers/message/fusion/mptsas.c mptsas_issue_tm(MPT_ADAPTER *ioc, u8 type, u8 channel, u8 id, u64 lun, · line 4833
Quoted 5 lines
drivers/message/fusion/mptsas.c +0
-2@@ -4829,8 +4828,6 @@ mptsas_issue_tm(MPT_ADAPTER *ioc, u8 type, u8 channel, u8 id, u64 lun,mpt_put_msg_frame_hi_pri (mptsasDeviceResetCtx, ioc, mf);/* Now wait for the command to complete */ - timeleft =wait_for_completion_timeout (&ioc->taskmgmt_cmds.done, - timeout*HZ );
It looks bad to remove the call to wait_for_completion_timeout(). Is it truly not needed? If it's needed, the "timeleft" should be checked or a comment left to explain why it's not checked.
-bw
Quoted 7 lines
drivers/message/fusion/mptsas.c +0
-1if (!(ioc->taskmgmt_cmds.status &MPT_MGMT_STATUS_COMMAND_GOOD )) { retval =-1 ;/* return failure */ dtmprintk(ioc, printk(MYIOC_s_ERR_FMT --2.27.0
Quoted 28 lines · Bill Wendling
Quoted 27 lines · Tom Rix
clang with W=1 reports
drivers/message/fusion/mptsas.c:4796:17: error: variable
'timeleft' set but not used [-Werror,-Wunused-but-set-variable]unsigned long timeleft; ^This variable is not used so remove it.
Signed-off-by Tom Rix <[email protected]>--- drivers/message/fusion/mptsas.c | 3 --- 1 file changed, 3 deletions(-)drivers/message/fusion/mptsas.c +0
-1@@ -4793,7 +4793,6 @@ mptsas_issue_tm(MPT_ADAPTER *ioc, u8 type, u8 channel, u8 id, u64 lun,MPT_FRAME_HDR *mf;SCSITaskMgmt_t *pScsiTm;int retval; -unsigned long timeleft; *issue_reset =0 ; mf =mpt_get_msg_frame (mptsasDeviceResetCtx, ioc);@@ -4829,8 +4828,6 @@ mptsas_issue_tm(MPT_ADAPTER *ioc, u8 type, u8 channel, u8 id, u64 lun,mpt_put_msg_frame_hi_pri (mptsasDeviceResetCtx, ioc, mf);
Quoted 6 lines
drivers/message/fusion/mptsas.c mptsas_issue_tm(MPT_ADAPTER *ioc, u8 type, u8 channel, u8 id, u64 lun, · line 4833
Quoted 3 lines
drivers/message/fusion/mptsas.c +0
-2/* Now wait for the command to complete */ - timeleft =wait_for_completion_timeout (&ioc->taskmgmt_cmds.done, - timeout*HZ );It looks bad to remove the call to
wait_for_completion_timeout(). Is it truly not needed? If it's needed, the "timeleft" should be checked or a comment left to explain why it's not checked.
Yeah. this is a screw up on my part, sorry.
T
Quoted 10 lines
-bw
Quoted 7 lines
drivers/message/fusion/mptsas.c +0
-1if (!(ioc->taskmgmt_cmds.status &MPT_MGMT_STATUS_COMMAND_GOOD )) { retval =-1 ;/* return failure */ dtmprintk(ioc, printk(MYIOC_s_ERR_FMT --2.27.0