提交 fe6b52c9 编写于 作者: B Bart Van Assche 提交者: Martin K. Petersen

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: NBart Van Assche <bvanassche@acm.org>
Tested-by: NHimanshu Madhani <hmadhani@marvell.com>
Reviewed-by: NHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 1778a0e7
......@@ -136,7 +136,7 @@ static int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait)
sp = qla2xxx_get_qpair_sp(cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport,
GFP_ATOMIC);
if (!sp)
goto done;
return rval;
abt_iocb = &sp->u.iocb_cmd;
sp->type = SRB_ABT_CMD;
......@@ -160,20 +160,18 @@ static int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait)
cmd_sp->type);
rval = qla2x00_start_sp(sp);
if (rval != QLA_SUCCESS)
goto done_free_sp;
if (rval != QLA_SUCCESS) {
sp->free(sp);
return rval;
}
if (wait) {
wait_for_completion(&abt_iocb->u.abt.comp);
rval = abt_iocb->u.abt.comp_status == CS_COMPLETE ?
QLA_SUCCESS : QLA_FUNCTION_FAILED;
} else {
goto done;
sp->free(sp);
}
done_free_sp:
sp->free(sp);
done:
return rval;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册