]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ata: libata-sata: simplify ata_sas_queuecmd()
authorDamien Le Moal <dlemoal@kernel.org>
Wed, 18 Feb 2026 23:18:52 +0000 (08:18 +0900)
committerDamien Le Moal <dlemoal@kernel.org>
Tue, 24 Feb 2026 00:40:58 +0000 (09:40 +0900)
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>
drivers/ata/libata-sata.c

index b9d635088f5fbdd87bf8f45df9f9e31442bd4ab9..2ee54d60ea4b7046e08ed8405c8e7684b91f50e0 100644 (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);