mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
usb: gadget: f_tcm: Refactor goto check_condition
Move the command initialization before the check_condition to after the goto statement for a cleaner look. No functional change here. Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/8442364f51f2788d2a191997581a8eda7a143272.1733876548.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
de92fb3fc2
commit
d7123c77dc
1 changed files with 12 additions and 14 deletions
|
|
@ -1223,14 +1223,8 @@ static void usbg_submit_cmd(struct usbg_cmd *cmd)
|
|||
tpg = cmd->fu->tpg;
|
||||
tv_nexus = tpg->tpg_nexus;
|
||||
dir = get_cmd_dir(cmd->cmd_buf);
|
||||
if (dir < 0) {
|
||||
__target_init_cmd(se_cmd,
|
||||
tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo,
|
||||
tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE,
|
||||
cmd->prio_attr, cmd->sense_iu.sense,
|
||||
cmd->unpacked_lun, NULL);
|
||||
if (dir < 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, cmd->cmd_buf,
|
||||
cmd->sense_iu.sense, cmd->unpacked_lun, 0,
|
||||
|
|
@ -1239,6 +1233,11 @@ static void usbg_submit_cmd(struct usbg_cmd *cmd)
|
|||
return;
|
||||
|
||||
out:
|
||||
__target_init_cmd(se_cmd,
|
||||
tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo,
|
||||
tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE,
|
||||
cmd->prio_attr, cmd->sense_iu.sense,
|
||||
cmd->unpacked_lun, NULL);
|
||||
transport_send_check_condition_and_sense(se_cmd,
|
||||
TCM_UNSUPPORTED_SCSI_OPCODE, 0);
|
||||
}
|
||||
|
|
@ -1484,14 +1483,8 @@ static void bot_cmd_work(struct work_struct *work)
|
|||
tpg = cmd->fu->tpg;
|
||||
tv_nexus = tpg->tpg_nexus;
|
||||
dir = get_cmd_dir(cmd->cmd_buf);
|
||||
if (dir < 0) {
|
||||
__target_init_cmd(se_cmd,
|
||||
tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo,
|
||||
tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE,
|
||||
cmd->prio_attr, cmd->sense_iu.sense,
|
||||
cmd->unpacked_lun, NULL);
|
||||
if (dir < 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess,
|
||||
cmd->cmd_buf, cmd->sense_iu.sense, cmd->unpacked_lun,
|
||||
|
|
@ -1499,6 +1492,11 @@ static void bot_cmd_work(struct work_struct *work)
|
|||
return;
|
||||
|
||||
out:
|
||||
__target_init_cmd(se_cmd,
|
||||
tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo,
|
||||
tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE,
|
||||
cmd->prio_attr, cmd->sense_iu.sense,
|
||||
cmd->unpacked_lun, NULL);
|
||||
transport_send_check_condition_and_sense(se_cmd,
|
||||
TCM_UNSUPPORTED_SCSI_OPCODE, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue