diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2020-07-06 15:33:51 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-07-08 08:02:59 +0300 |
commit | aa055885ebada98f12b0b394d7a06a5ae0d66e8c (patch) | |
tree | 16324ba1e2f28abf0d46d61f1748ad04a84b1946 /drivers/scsi/megaraid.c | |
parent | 2a6576d29d3b153b58fbaf2bd0ebc5fce424d73b (diff) | |
download | linux-aa055885ebada98f12b0b394d7a06a5ae0d66e8c.tar.xz |
scsi: megaraid: Fix set but unused variable
In megadev_ioctl(), if MEGA_HAVE_STATS is not defined, the variables
num_ldrv and ustats are unused. Conditionally define them to avoid compiler
warnings.
Link: https://lore.kernel.org/r/20200706123351.451959-1-damien.lemoal@wdc.com
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid.c')
-rw-r--r-- | drivers/scsi/megaraid.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 96ecf5929e68..acd7c6ed77b1 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -2975,14 +2975,13 @@ megadev_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) void *data = NULL; /* data to be transferred */ dma_addr_t data_dma_hndl; /* dma handle for data xfer area */ megacmd_t mc; - megastat_t __user *ustats; - int num_ldrv; +#if MEGA_HAVE_STATS + megastat_t __user *ustats = NULL; + int num_ldrv = 0; +#endif u32 uxferaddr = 0; struct pci_dev *pdev; - ustats = NULL; /* avoid compilation warnings */ - num_ldrv = 0; - /* * Make sure only USCSICMD are issued through this interface. * MIMD application would still fire different command. |