public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: message: fusion: Remove unused variable
@ 2024-08-07  9:39 Breno Leitao
  2024-08-07 20:46 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Breno Leitao @ 2024-08-07  9:39 UTC (permalink / raw)
  To: martin.petersen, Sathya Prakash, Sreekanth Reddy,
	Suganath Prabu Subramani
  Cc: leit, open list:LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI),
	open list:LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI), open list

There are two unused variable in mptsas, and the compiler complains
about it. Let's get them removed.

	drivers/message/fusion/mptsas.c:4234:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
	 4234 |         int rc;
	drivers/message/fusion/mptsas.c:4793:17: warning: variable 'timeleft' set but not used [-Wunused-but-set-variable]
	 4793 |         unsigned long    timeleft;

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 drivers/message/fusion/mptsas.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index a0bcb0864ecd..cd920faff16a 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -4231,10 +4231,8 @@ mptsas_find_phyinfo_by_phys_disk_num(MPT_ADAPTER *ioc, u8 phys_disk_num,
 static void
 mptsas_reprobe_lun(struct scsi_device *sdev, void *data)
 {
-	int rc;
-
 	sdev->no_uld_attach = data ? 1 : 0;
-	rc = scsi_device_reprobe(sdev);
+	scsi_device_reprobe(sdev);
 }
 
 static void
@@ -4790,7 +4788,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);
@@ -4826,8 +4823,7 @@ 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);
+	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.43.5


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

* Re: [PATCH] scsi: message: fusion: Remove unused variable
  2024-08-07  9:39 [PATCH] scsi: message: fusion: Remove unused variable Breno Leitao
@ 2024-08-07 20:46 ` kernel test robot
  2024-08-07 21:27 ` kernel test robot
  2024-08-13  1:39 ` Martin K. Petersen
  2 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2024-08-07 20:46 UTC (permalink / raw)
  To: Breno Leitao, martin.petersen, Sathya Prakash, Sreekanth Reddy,
	Suganath Prabu Subramani
  Cc: oe-kbuild-all, leit,
	open list:LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI), open list

Hi Breno,

kernel test robot noticed the following build warnings:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on linus/master v6.11-rc2 next-20240807]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Breno-Leitao/scsi-message-fusion-Remove-unused-variable/20240807-174402
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
patch link:    https://lore.kernel.org/r/20240807094000.398857-1-leitao%40debian.org
patch subject: [PATCH] scsi: message: fusion: Remove unused variable
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20240808/202408080428.XtCwqGet-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240808/202408080428.XtCwqGet-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408080428.XtCwqGet-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/message/fusion/mptsas.c: In function 'mptsas_reprobe_lun':
>> drivers/message/fusion/mptsas.c:4235:9: warning: ignoring return value of 'scsi_device_reprobe' declared with attribute 'warn_unused_result' [-Wunused-result]
    4235 |         scsi_device_reprobe(sdev);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~


vim +4235 drivers/message/fusion/mptsas.c

  4230	
  4231	static void
  4232	mptsas_reprobe_lun(struct scsi_device *sdev, void *data)
  4233	{
  4234		sdev->no_uld_attach = data ? 1 : 0;
> 4235		scsi_device_reprobe(sdev);
  4236	}
  4237	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH] scsi: message: fusion: Remove unused variable
  2024-08-07  9:39 [PATCH] scsi: message: fusion: Remove unused variable Breno Leitao
  2024-08-07 20:46 ` kernel test robot
@ 2024-08-07 21:27 ` kernel test robot
  2024-08-13  1:39 ` Martin K. Petersen
  2 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2024-08-07 21:27 UTC (permalink / raw)
  To: Breno Leitao, martin.petersen, Sathya Prakash, Sreekanth Reddy,
	Suganath Prabu Subramani
  Cc: llvm, oe-kbuild-all, leit,
	open list:LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI), open list

Hi Breno,

kernel test robot noticed the following build warnings:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on linus/master v6.11-rc2 next-20240807]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Breno-Leitao/scsi-message-fusion-Remove-unused-variable/20240807-174402
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
patch link:    https://lore.kernel.org/r/20240807094000.398857-1-leitao%40debian.org
patch subject: [PATCH] scsi: message: fusion: Remove unused variable
config: i386-buildonly-randconfig-001-20240808 (https://download.01.org/0day-ci/archive/20240808/202408080515.uSFIs9Q0-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240808/202408080515.uSFIs9Q0-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408080515.uSFIs9Q0-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/message/fusion/mptsas.c:4235:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
    4235 |         scsi_device_reprobe(sdev);
         |         ^~~~~~~~~~~~~~~~~~~ ~~~~
   1 warning generated.


vim +/warn_unused_result +4235 drivers/message/fusion/mptsas.c

  4230	
  4231	static void
  4232	mptsas_reprobe_lun(struct scsi_device *sdev, void *data)
  4233	{
  4234		sdev->no_uld_attach = data ? 1 : 0;
> 4235		scsi_device_reprobe(sdev);
  4236	}
  4237	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH] scsi: message: fusion: Remove unused variable
  2024-08-07  9:39 [PATCH] scsi: message: fusion: Remove unused variable Breno Leitao
  2024-08-07 20:46 ` kernel test robot
  2024-08-07 21:27 ` kernel test robot
@ 2024-08-13  1:39 ` Martin K. Petersen
  2024-08-13  1:42   ` Martin K. Petersen
  2 siblings, 1 reply; 6+ messages in thread
From: Martin K. Petersen @ 2024-08-13  1:39 UTC (permalink / raw)
  To: Breno Leitao
  Cc: martin.petersen, Sathya Prakash, Sreekanth Reddy,
	Suganath Prabu Subramani, leit,
	open list:LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI),
	open list:LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI), open list


Breno,

> There are two unused variable in mptsas, and the compiler complains
> about it. Let's get them removed.

Applied to 6.12/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] scsi: message: fusion: Remove unused variable
  2024-08-13  1:39 ` Martin K. Petersen
@ 2024-08-13  1:42   ` Martin K. Petersen
  2024-08-13  8:10     ` Breno Leitao
  0 siblings, 1 reply; 6+ messages in thread
From: Martin K. Petersen @ 2024-08-13  1:42 UTC (permalink / raw)
  To: Breno Leitao
  Cc: Sathya Prakash, Sreekanth Reddy, Suganath Prabu Subramani, leit,
	open list:LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI),
	open list:LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI), open list


> Applied to 6.12/scsi-staging, thanks!

drivers/message/fusion/mptsas.c: In function ‘mptsas_reprobe_lun’:
drivers/message/fusion/mptsas.c:4235:9: error: ignoring return value of ‘scsi_device_reprobe’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
 4235 |         scsi_device_reprobe(sdev);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~

Dropped again.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] scsi: message: fusion: Remove unused variable
  2024-08-13  1:42   ` Martin K. Petersen
@ 2024-08-13  8:10     ` Breno Leitao
  0 siblings, 0 replies; 6+ messages in thread
From: Breno Leitao @ 2024-08-13  8:10 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Sathya Prakash, Sreekanth Reddy, Suganath Prabu Subramani, leit,
	open list:LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI),
	open list:LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI), open list

On Mon, Aug 12, 2024 at 09:42:33PM -0400, Martin K. Petersen wrote:
> 
> > Applied to 6.12/scsi-staging, thanks!
> 
> drivers/message/fusion/mptsas.c: In function ‘mptsas_reprobe_lun’:
> drivers/message/fusion/mptsas.c:4235:9: error: ignoring return value of ‘scsi_device_reprobe’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
>  4235 |         scsi_device_reprobe(sdev);
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~
> 
Let me handle it, and send a v2.

Thanks
--breno

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

end of thread, other threads:[~2024-08-13  8:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07  9:39 [PATCH] scsi: message: fusion: Remove unused variable Breno Leitao
2024-08-07 20:46 ` kernel test robot
2024-08-07 21:27 ` kernel test robot
2024-08-13  1:39 ` Martin K. Petersen
2024-08-13  1:42   ` Martin K. Petersen
2024-08-13  8:10     ` Breno Leitao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox