Re: [PATCH v2 30/44] mvsas: Fix a set-but-not-used warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/02/2022 17:25, Bart Van Assche wrote:
This patch fixes the following compiler warning:

drivers/scsi/mvsas/mv_init.c: In function ‘mvs_pci_init’:
drivers/scsi/mvsas/mv_init.c:497:30: warning: variable ‘mpi’ set but not used [-Wunused-but-set-variable]
   497 |         struct mvs_prv_info *mpi;
       |                              ^~~

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>

Regardless of a somewhat useful comment, below (2nd), feel free to add:

Reviewed-by: John Garry <john.garry@xxxxxxxxxx>

---
  drivers/scsi/mvsas/mv_init.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
index dcae2d4464f9..d82b3129119a 100644
--- a/drivers/scsi/mvsas/mv_init.c
+++ b/drivers/scsi/mvsas/mv_init.c
@@ -494,7 +494,6 @@ static int mvs_pci_init(struct pci_dev *pdev, const struct pci_device_id *ent)
  {
  	unsigned int rc, nhost = 0;
  	struct mvs_info *mvi;
-	struct mvs_prv_info *mpi;
  	irq_handler_t irq_handler = mvs_interrupt;
  	struct Scsi_Host *shost = NULL;
  	const struct mvs_chip_info *chip;
@@ -559,10 +558,14 @@ static int mvs_pci_init(struct pci_dev *pdev, const struct pci_device_id *ent)
  		}
  		nhost++;
  	} while (nhost < chip->n_host);
-	mpi = (struct mvs_prv_info *)(SHOST_TO_SAS_HA(shost)->lldd_ha);
  #ifdef CONFIG_SCSI_MVSAS_TASKLET

I really doubt the value such config options

+	{
+	struct mvs_prv_info *mpi;
+
+	mpi = (struct mvs_prv_info *)(SHOST_TO_SAS_HA(shost)->lldd_ha);

nit: I don't think that we require the cast to struct mvs_prv_info *

  	tasklet_init(&(mpi->mv_tasklet), mvs_tasklet,
  		     (unsigned long)SHOST_TO_SAS_HA(shost));
+	}
  #endif
mvs_post_sas_ha_init(shost, chip);
.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux