All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: message: fusion: remove unused timeleft variable
@ 2023-03-31 16:26 Tom Rix
  2023-03-31 19:40 ` Bill Wendling
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Rix @ 2023-03-31 16:26 UTC (permalink / raw
  To: sathya.prakash, sreekanth.reddy, suganath-prabu.subramani, nathan,
	ndesaulniers
  Cc: MPT-FusionLinux.pdl, linux-scsi, linux-kernel, llvm, 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 <trix@redhat.com>
---
 drivers/message/fusion/mptsas.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 86f16f3ea478..d458665e2fc9 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -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
-- 
2.27.0


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

* Re: [PATCH] scsi: message: fusion: remove unused timeleft variable
  2023-03-31 16:26 [PATCH] scsi: message: fusion: remove unused timeleft variable Tom Rix
@ 2023-03-31 19:40 ` Bill Wendling
  2023-03-31 21:03   ` Tom Rix
  0 siblings, 1 reply; 3+ messages in thread
From: Bill Wendling @ 2023-03-31 19:40 UTC (permalink / raw
  To: Tom Rix
  Cc: sathya.prakash, sreekanth.reddy, suganath-prabu.subramani, nathan,
	ndesaulniers, MPT-FusionLinux.pdl, linux-scsi, linux-kernel, llvm

On Fri, Mar 31, 2023 at 9:26 AM Tom Rix <trix@redhat.com> wrote:
>
> 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 <trix@redhat.com>
> ---
>  drivers/message/fusion/mptsas.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
> index 86f16f3ea478..d458665e2fc9 100644
> --- a/drivers/message/fusion/mptsas.c
> +++ b/drivers/message/fusion/mptsas.c
> @@ -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);

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

>         if (!(ioc->taskmgmt_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD)) {
>                 retval = -1; /* return failure */
>                 dtmprintk(ioc, printk(MYIOC_s_ERR_FMT
> --
> 2.27.0
>
>

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

* Re: [PATCH] scsi: message: fusion: remove unused timeleft variable
  2023-03-31 19:40 ` Bill Wendling
@ 2023-03-31 21:03   ` Tom Rix
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Rix @ 2023-03-31 21:03 UTC (permalink / raw
  To: Bill Wendling
  Cc: sathya.prakash, sreekanth.reddy, suganath-prabu.subramani, nathan,
	ndesaulniers, MPT-FusionLinux.pdl, linux-scsi, linux-kernel, llvm


On 3/31/23 12:40 PM, Bill Wendling wrote:
> On Fri, Mar 31, 2023 at 9:26 AM Tom Rix <trix@redhat.com> wrote:
>> 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 <trix@redhat.com>
>> ---
>>   drivers/message/fusion/mptsas.c | 3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
>> index 86f16f3ea478..d458665e2fc9 100644
>> --- a/drivers/message/fusion/mptsas.c
>> +++ b/drivers/message/fusion/mptsas.c
>> @@ -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);
> 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

>
> -bw
>
>>          if (!(ioc->taskmgmt_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD)) {
>>                  retval = -1; /* return failure */
>>                  dtmprintk(ioc, printk(MYIOC_s_ERR_FMT
>> --
>> 2.27.0
>>
>>


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

end of thread, other threads:[~2023-03-31 21:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-31 16:26 [PATCH] scsi: message: fusion: remove unused timeleft variable Tom Rix
2023-03-31 19:40 ` Bill Wendling
2023-03-31 21:03   ` Tom Rix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.