From: Damien Le Moal Date: Wed, 18 Feb 2026 23:18:52 +0000 (+0900) Subject: ata: libata-sata: simplify ata_sas_queuecmd() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a21b4040b3886555cba5e72ef475a556ad04700d;p=thirdparty%2Flinux.git 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 Reviewed-by: Hannes Reinecke --- diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index b9d635088f5fb..2ee54d60ea4b7 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -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);