diff options
author | Lee Jones <lee.jones@linaro.org> | 2020-07-21 17:41:47 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-07-24 22:36:46 -0400 |
commit | 6eaa862747eadbec42600031c93e6e52a2d1edda (patch) | |
tree | d7dbaba459e5a2dfb3d793022d7bd077d9a7e087 /drivers/scsi | |
parent | e3903d31826fc1732bc5745fb9a8686bfa49444f (diff) |
scsi: mvsas: Move 'core_nr' inside #ifdef and remove unused variable 'res_flag'
Only declare 'core_nr' if its conditions for use are met.
Fixes the following W=1 kernel build warning(s):
drivers/scsi/mvsas/mv_init.c: In function ‘mvs_interrupt’:
drivers/scsi/mvsas/mv_init.c:180:6: warning: variable ‘core_nr’ set but not used [-Wunused-but-set-variable]
drivers/scsi/mvsas/mv_init.c: In function ‘mvs_ioremap’:
drivers/scsi/mvsas/mv_init.c:302:36: warning: variable ‘res_flag’ set but not used [-Wunused-but-set-variable]
[mkp: applied follow-up fixup patch]
Link: https://lore.kernel.org/r/20200721164148.2617584-40-lee.jones@linaro.org
Cc: Jason Yan <yanaijie@huawei.com>
Cc: Marvell <kewei@marvell.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/mvsas/mv_init.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index 5973eed94938..7ec9aa761979 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c @@ -176,15 +176,16 @@ out: static irqreturn_t mvs_interrupt(int irq, void *opaque) { - u32 core_nr; u32 stat; struct mvs_info *mvi; struct sas_ha_struct *sha = opaque; #ifndef CONFIG_SCSI_MVSAS_TASKLET u32 i; -#endif + u32 core_nr; core_nr = ((struct mvs_prv_info *)sha->lldd_ha)->n_host; +#endif + mvi = ((struct mvs_prv_info *)sha->lldd_ha)->mvi[0]; if (unlikely(!mvi)) @@ -298,7 +299,7 @@ err_out: int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex) { - unsigned long res_start, res_len, res_flag, res_flag_ex = 0; + unsigned long res_start, res_len, res_flag_ex = 0; struct pci_dev *pdev = mvi->pdev; if (bar_ex != -1) { /* @@ -326,7 +327,6 @@ int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex) goto err_out; } - res_flag = pci_resource_flags(pdev, bar); mvi->regs = ioremap(res_start, res_len); if (!mvi->regs) { |