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: Simplify qla24xx_async_abort_cmd()

Make the code easier to read by converting 'goto' statements into
'return' statements.

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
fe6b52c9 1778a0e7

+6 -8
+6 -8
drivers/scsi/qla2xxx/qla_init.c
··· 136 136 sp = qla2xxx_get_qpair_sp(cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport, 137 137 GFP_ATOMIC); 138 138 if (!sp) 139 - goto done; 139 + return rval; 140 140 141 141 abt_iocb = &sp->u.iocb_cmd; 142 142 sp->type = SRB_ABT_CMD; ··· 160 160 cmd_sp->type); 161 161 162 162 rval = qla2x00_start_sp(sp); 163 - if (rval != QLA_SUCCESS) 164 - goto done_free_sp; 163 + if (rval != QLA_SUCCESS) { 164 + sp->free(sp); 165 + return rval; 166 + } 165 167 166 168 if (wait) { 167 169 wait_for_completion(&abt_iocb->u.abt.comp); 168 170 rval = abt_iocb->u.abt.comp_status == CS_COMPLETE ? 169 171 QLA_SUCCESS : QLA_FUNCTION_FAILED; 170 - } else { 171 - goto done; 172 + sp->free(sp); 172 173 } 173 174 174 - done_free_sp: 175 - sp->free(sp); 176 - done: 177 175 return rval; 178 176 } 179 177