Commit 4fb2169d authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: qla2xxx: Fix set-but-not-used variable warnings

Fix the following two compiler warnings:

drivers/scsi/qla2xxx/qla_init.c: In function ‘qla24xx_async_abort_cmd’:
drivers/scsi/qla2xxx/qla_init.c:171:17: warning: variable ‘bail’ set but not used [-Wunused-but-set-variable]
  171 |         uint8_t bail;
      |                 ^~~~
drivers/scsi/qla2xxx/qla_init.c: In function ‘qla2x00_async_tm_cmd’:
drivers/scsi/qla2xxx/qla_init.c:2023:17: warning: variable ‘bail’ set but not used [-Wunused-but-set-variable]
 2023 |         uint8_t bail;
      |                 ^~~~

Cc: Arun Easi <arun.easi@qlogic.com>
Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
Fixes: feafb7b1 ("[SCSI] qla2xxx: Fix vport delete issues")
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20221031224818.2607882-1-bvanassche@acm.orgSigned-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 2e79cf37
...@@ -5136,17 +5136,17 @@ struct secure_flash_update_block_pk { ...@@ -5136,17 +5136,17 @@ struct secure_flash_update_block_pk {
(test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \ (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \
test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))
#define QLA_VHA_MARK_BUSY(__vha, __bail) do { \ static inline bool qla_vha_mark_busy(scsi_qla_host_t *vha)
atomic_inc(&__vha->vref_count); \ {
mb(); \ atomic_inc(&vha->vref_count);
if (__vha->flags.delete_progress) { \ mb();
atomic_dec(&__vha->vref_count); \ if (vha->flags.delete_progress) {
wake_up(&__vha->vref_waitq); \ atomic_dec(&vha->vref_count);
__bail = 1; \ wake_up(&vha->vref_waitq);
} else { \ return true;
__bail = 0; \ }
} \ return false;
} while (0) }
#define QLA_VHA_MARK_NOT_BUSY(__vha) do { \ #define QLA_VHA_MARK_NOT_BUSY(__vha) do { \
atomic_dec(&__vha->vref_count); \ atomic_dec(&__vha->vref_count); \
......
...@@ -168,7 +168,6 @@ int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) ...@@ -168,7 +168,6 @@ int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait)
struct srb_iocb *abt_iocb; struct srb_iocb *abt_iocb;
srb_t *sp; srb_t *sp;
int rval = QLA_FUNCTION_FAILED; int rval = QLA_FUNCTION_FAILED;
uint8_t bail;
/* ref: INIT for ABTS command */ /* ref: INIT for ABTS command */
sp = qla2xxx_get_qpair_sp(cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport, sp = qla2xxx_get_qpair_sp(cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport,
...@@ -176,7 +175,7 @@ int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) ...@@ -176,7 +175,7 @@ int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait)
if (!sp) if (!sp)
return QLA_MEMORY_ALLOC_FAILED; return QLA_MEMORY_ALLOC_FAILED;
QLA_VHA_MARK_BUSY(vha, bail); qla_vha_mark_busy(vha);
abt_iocb = &sp->u.iocb_cmd; abt_iocb = &sp->u.iocb_cmd;
sp->type = SRB_ABT_CMD; sp->type = SRB_ABT_CMD;
sp->name = "abort"; sp->name = "abort";
...@@ -2020,14 +2019,13 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun, ...@@ -2020,14 +2019,13 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun,
struct srb_iocb *tm_iocb; struct srb_iocb *tm_iocb;
srb_t *sp; srb_t *sp;
int rval = QLA_FUNCTION_FAILED; int rval = QLA_FUNCTION_FAILED;
uint8_t bail;
/* ref: INIT */ /* ref: INIT */
sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
if (!sp) if (!sp)
goto done; goto done;
QLA_VHA_MARK_BUSY(vha, bail); qla_vha_mark_busy(vha);
sp->type = SRB_TM_CMD; sp->type = SRB_TM_CMD;
sp->name = "tmf"; sp->name = "tmf";
qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha), qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha),
......
...@@ -225,11 +225,9 @@ static inline srb_t * ...@@ -225,11 +225,9 @@ static inline srb_t *
qla2x00_get_sp(scsi_qla_host_t *vha, fc_port_t *fcport, gfp_t flag) qla2x00_get_sp(scsi_qla_host_t *vha, fc_port_t *fcport, gfp_t flag)
{ {
srb_t *sp = NULL; srb_t *sp = NULL;
uint8_t bail;
struct qla_qpair *qpair; struct qla_qpair *qpair;
QLA_VHA_MARK_BUSY(vha, bail); if (unlikely(qla_vha_mark_busy(vha)))
if (unlikely(bail))
return NULL; return NULL;
qpair = vha->hw->base_qpair; qpair = vha->hw->base_qpair;
......
...@@ -5069,13 +5069,11 @@ struct qla_work_evt * ...@@ -5069,13 +5069,11 @@ struct qla_work_evt *
qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type) qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type)
{ {
struct qla_work_evt *e; struct qla_work_evt *e;
uint8_t bail;
if (test_bit(UNLOADING, &vha->dpc_flags)) if (test_bit(UNLOADING, &vha->dpc_flags))
return NULL; return NULL;
QLA_VHA_MARK_BUSY(vha, bail); if (qla_vha_mark_busy(vha))
if (bail)
return NULL; return NULL;
e = kzalloc(sizeof(struct qla_work_evt), GFP_ATOMIC); e = kzalloc(sizeof(struct qla_work_evt), GFP_ATOMIC);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment