diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-04-17 14:44:34 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-04-29 17:24:51 -0400 |
commit | 982cc4be05d6d0d8b15b1340416737ad60bddcae (patch) | |
tree | 0ad79bef5e1fa62702341387cfa8cfb247078716 /drivers/scsi/qla2xxx/qla_mid.c | |
parent | 1956eee58872e622cfe03f060a5d8a20d24afe47 (diff) |
scsi: qla2xxx: Use an on-stack completion in qla24xx_control_vp()
This patch reduces the size of struct srb.
Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mid.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mid.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 099d8e9851cb..b2977e49356b 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -905,7 +905,8 @@ static void qla_ctrlvp_sp_done(void *s, int res) { struct srb *sp = s; - complete(&sp->comp); + if (sp->comp) + complete(sp->comp); /* don't free sp here. Let the caller do the free */ } @@ -922,6 +923,7 @@ int qla24xx_control_vp(scsi_qla_host_t *vha, int cmd) struct qla_hw_data *ha = vha->hw; int vp_index = vha->vp_idx; struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); + DECLARE_COMPLETION_ONSTACK(comp); srb_t *sp; ql_dbg(ql_dbg_vport, vha, 0x10c1, @@ -936,6 +938,7 @@ int qla24xx_control_vp(scsi_qla_host_t *vha, int cmd) sp->type = SRB_CTRL_VP; sp->name = "ctrl_vp"; + sp->comp = ∁ sp->done = qla_ctrlvp_sp_done; sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); @@ -953,7 +956,9 @@ int qla24xx_control_vp(scsi_qla_host_t *vha, int cmd) ql_dbg(ql_dbg_vport, vha, 0x113f, "%s hndl %x submitted\n", sp->name, sp->handle); - wait_for_completion(&sp->comp); + wait_for_completion(&comp); + sp->comp = NULL; + rval = sp->rc; switch (rval) { case QLA_FUNCTION_TIMEOUT: |