From: Damien Le Moal <dlemoal@kernel.org>
To: linux-ide@vger.kernel.org, Niklas Cassel <cassel@kernel.org>
Subject: [PATCH 2/5] ata: libata-sata: simplify ata_sas_queuecmd()
Date: Thu, 19 Feb 2026 15:23:09 +0900 [thread overview]
Message-ID: <20260219062312.1030867-3-dlemoal@kernel.org> (raw)
In-Reply-To: <20260219062312.1030867-1-dlemoal@kernel.org>
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>
---
drivers/ata/libata-sata.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
index 04e1e774645e..00f7e5443e3d 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);
--
2.53.0
next prev parent reply other threads:[~2026-02-19 6:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-19 6:23 [PATCH 0/5] libata cleanups Damien Le Moal
2026-02-19 6:23 ` [PATCH 1/5] ata: libata-core: improve tag checks in ata_qc_issue() Damien Le Moal
2026-02-19 8:19 ` Hannes Reinecke
2026-02-19 6:23 ` Damien Le Moal [this message]
2026-02-19 8:20 ` [PATCH 2/5] ata: libata-sata: simplify ata_sas_queuecmd() Hannes Reinecke
2026-02-19 6:23 ` [PATCH 3/5] ata: libata-scsi: simplify ata_scsi_schedule_deferred_qc() Damien Le Moal
2026-02-19 7:52 ` Sergey Shtylyov
2026-02-19 8:21 ` Hannes Reinecke
2026-02-19 21:38 ` Damien Le Moal
2026-02-19 6:23 ` [PATCH 4/5] ata: libata-scsi: make ata_scsi_simulate() static Damien Le Moal
2026-02-19 8:22 ` Hannes Reinecke
2026-02-19 6:23 ` [PATCH 5/5] ata: libata-scsi: rename and improve ata_qc_done() Damien Le Moal
2026-02-19 8:26 ` Hannes Reinecke
2026-02-24 0:43 ` [PATCH 0/5] libata cleanups Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260219062312.1030867-3-dlemoal@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox