ata: libata-sata: simplify ata_sas_queuecmd()

Change ata_sas_queuecmd() to return early the result of
__ata_scsi_queuecmd() and remove the rc local variable.
This simplifies the code without any functional change.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
This commit is contained in:
Damien Le Moal 2026-02-19 08:18:52 +09:00
parent 6158e34e59
commit a21b4040b3

View File

@ -1378,15 +1378,13 @@ EXPORT_SYMBOL_GPL(ata_sas_sdev_configure);
int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap)
{
int rc = 0;
if (likely(ata_dev_enabled(ap->link.device)))
rc = __ata_scsi_queuecmd(cmd, ap->link.device);
else {
cmd->result = (DID_BAD_TARGET << 16);
scsi_done(cmd);
}
return rc;
return __ata_scsi_queuecmd(cmd, ap->link.device);
cmd->result = (DID_BAD_TARGET << 16);
scsi_done(cmd);
return 0;
}
EXPORT_SYMBOL_GPL(ata_sas_queuecmd);