Skip to content

Commit a21b404

Browse files
committed
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>
1 parent 6158e34 commit a21b404

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

drivers/ata/libata-sata.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,15 +1378,13 @@ EXPORT_SYMBOL_GPL(ata_sas_sdev_configure);
13781378

13791379
int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap)
13801380
{
1381-
int rc = 0;
1382-
13831381
if (likely(ata_dev_enabled(ap->link.device)))
1384-
rc = __ata_scsi_queuecmd(cmd, ap->link.device);
1385-
else {
1386-
cmd->result = (DID_BAD_TARGET << 16);
1387-
scsi_done(cmd);
1388-
}
1389-
return rc;
1382+
return __ata_scsi_queuecmd(cmd, ap->link.device);
1383+
1384+
cmd->result = (DID_BAD_TARGET << 16);
1385+
scsi_done(cmd);
1386+
1387+
return 0;
13901388
}
13911389
EXPORT_SYMBOL_GPL(ata_sas_queuecmd);
13921390

0 commit comments

Comments
 (0)