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>
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);