Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: qla2xxx: Introduce the function qla2xxx_init_sp()

This patch does not change any functionality but makes the next patch
easier to read.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
bdb61b9b 6c18a43e

+15 -13
+15 -13
drivers/scsi/qla2xxx/qla_inline.h
··· 152 152 return (qla2x00_reset_active(vha) || !vha->hw->flags.fw_started); 153 153 } 154 154 155 + static void qla2xxx_init_sp(srb_t *sp, scsi_qla_host_t *vha, 156 + struct qla_qpair *qpair, fc_port_t *fcport) 157 + { 158 + memset(sp, 0, sizeof(*sp)); 159 + sp->fcport = fcport; 160 + sp->iocbs = 1; 161 + sp->vha = vha; 162 + sp->qpair = qpair; 163 + sp->cmd_type = TYPE_SRB; 164 + INIT_LIST_HEAD(&sp->elem); 165 + } 166 + 155 167 static inline srb_t * 156 168 qla2xxx_get_qpair_sp(scsi_qla_host_t *vha, struct qla_qpair *qpair, 157 169 fc_port_t *fcport, gfp_t flag) ··· 176 164 return NULL; 177 165 178 166 sp = mempool_alloc(qpair->srb_mempool, flag); 179 - if (!sp) 180 - goto done; 181 - 182 - memset(sp, 0, sizeof(*sp)); 183 - sp->fcport = fcport; 184 - sp->iocbs = 1; 185 - sp->vha = vha; 186 - sp->qpair = qpair; 187 - sp->cmd_type = TYPE_SRB; 188 - INIT_LIST_HEAD(&sp->elem); 189 - 190 - done: 191 - if (!sp) 167 + if (sp) 168 + qla2xxx_init_sp(sp, vha, qpair, fcport); 169 + else 192 170 QLA_QPAIR_MARK_NOT_BUSY(qpair); 193 171 return sp; 194 172 }