mbox series

[0/3] scsi: mptfusion: Clear the warnings indicating that the variable is not used

Message ID 20210408061851.3089-1-thunder.leizhen@huawei.com (mailing list archive)
Headers show
Series scsi: mptfusion: Clear the warnings indicating that the variable is not used | expand

Message

Leizhen (ThunderTown) April 8, 2021, 6:18 a.m. UTC
Fix below warnings:
drivers/message/fusion/mptctl.c: In function ‘mptctl_do_taskmgmt’:
drivers/message/fusion/mptctl.c:324:17: warning: variable ‘time_count’ set but not used [-Wunused-but-set-variable]
  324 |  unsigned long  time_count;
      |                 ^~~~~~~~~~
drivers/message/fusion/mptctl.c: In function ‘mptctl_gettargetinfo’:
drivers/message/fusion/mptctl.c:1372:7: warning: variable ‘port’ set but not used [-Wunused-but-set-variable]
 1372 |  u8   port;
      |       ^~~~
drivers/message/fusion/mptctl.c: In function ‘mptctl_hp_hostinfo’:
drivers/message/fusion/mptctl.c:2337:8: warning: variable ‘retval’ set but not used [-Wunused-but-set-variable]
 2337 |  int   retval;
      |        ^~~~~~


Zhen Lei (3):
  scsi: mptfusion: Remove unused local variable 'time_count'
  scsi: mptfusion: Remove unused local variable 'port'
  scsi: mptfusion: Fix error return code of mptctl_hp_hostinfo()

 drivers/message/fusion/mptctl.c | 28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

Comments

Martin K. Petersen April 13, 2021, 5:07 a.m. UTC | #1
Zhen,

> Zhen Lei (3):
>   scsi: mptfusion: Remove unused local variable 'time_count'
>   scsi: mptfusion: Remove unused local variable 'port'
>   scsi: mptfusion: Fix error return code of mptctl_hp_hostinfo()

I applied patches 1+2. I hesitate making functional changes to such an
old driver.
Leizhen (ThunderTown) April 13, 2021, 7:25 a.m. UTC | #2
On 2021/4/13 13:07, Martin K. Petersen wrote:
> 
> Zhen,
> 
>> Zhen Lei (3):
>>   scsi: mptfusion: Remove unused local variable 'time_count'
>>   scsi: mptfusion: Remove unused local variable 'port'
>>   scsi: mptfusion: Fix error return code of mptctl_hp_hostinfo()
> 
> I applied patches 1+2. I hesitate making functional changes to such an
> old driver.

I think patch 3 does not change any functions. The current modification only
ensures that error codes are correctly returned in the error branch. In the
previous version, 0 is always returned.

>
Martin K. Petersen April 16, 2021, 2:51 a.m. UTC | #3
On Thu, 8 Apr 2021 14:18:48 +0800, Zhen Lei wrote:

> Fix below warnings:
> drivers/message/fusion/mptctl.c: In function ‘mptctl_do_taskmgmt’:
> drivers/message/fusion/mptctl.c:324:17: warning: variable ‘time_count’ set but not used [-Wunused-but-set-variable]
>   324 |  unsigned long  time_count;
>       |                 ^~~~~~~~~~
> drivers/message/fusion/mptctl.c: In function ‘mptctl_gettargetinfo’:
> drivers/message/fusion/mptctl.c:1372:7: warning: variable ‘port’ set but not used [-Wunused-but-set-variable]
>  1372 |  u8   port;
>       |       ^~~~
> drivers/message/fusion/mptctl.c: In function ‘mptctl_hp_hostinfo’:
> drivers/message/fusion/mptctl.c:2337:8: warning: variable ‘retval’ set but not used [-Wunused-but-set-variable]
>  2337 |  int   retval;
>       |        ^~~~~~
> 
> [...]

Applied to 5.13/scsi-queue, thanks!

[1/3] scsi: mptfusion: Remove unused local variable 'time_count'
      https://git.kernel.org/mkp/scsi/c/039cf3816648
[2/3] scsi: mptfusion: Remove unused local variable 'port'
      https://git.kernel.org/mkp/scsi/c/30264737bd95