From: Damien Le Moal <dlemoal@kernel.org>
To: linux-ide@vger.kernel.org, Niklas Cassel <cassel@kernel.org>
Cc: Hannes Reinecke <hare@suse.de>
Subject: [PATCH v2 2/6] ata: libata-scsi: Cleanup ata_scsi_offline_dev()
Date: Fri, 27 Jun 2025 16:52:03 +0900 [thread overview]
Message-ID: <20250627075207.23969-3-dlemoal@kernel.org> (raw)
In-Reply-To: <20250627075207.23969-1-dlemoal@kernel.org>
Change the function ata_scsi_offline_dev() to return a bool and change
this function kdoc comment to have the correct mention of its call site.
No functional changes.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-scsi.c | 15 +++++++--------
drivers/ata/libata.h | 2 +-
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index ccd7651710be..b502b123008a 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4633,24 +4633,23 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
* ata_scsi_offline_dev - offline attached SCSI device
* @dev: ATA device to offline attached SCSI device for
*
- * This function is called from ata_eh_hotplug() and responsible
- * for taking the SCSI device attached to @dev offline. This
- * function is called with host lock which protects dev->sdev
- * against clearing.
+ * This function is called from ata_eh_detach_dev() and is responsible for
+ * taking the SCSI device attached to @dev offline. This function is
+ * called with host lock which protects dev->sdev against clearing.
*
* LOCKING:
* spin_lock_irqsave(host lock)
*
* RETURNS:
- * 1 if attached SCSI device exists, 0 otherwise.
+ * true if attached SCSI device exists, false otherwise.
*/
-int ata_scsi_offline_dev(struct ata_device *dev)
+bool ata_scsi_offline_dev(struct ata_device *dev)
{
if (dev->sdev) {
scsi_device_set_state(dev->sdev, SDEV_OFFLINE);
- return 1;
+ return true;
}
- return 0;
+ return false;
}
/**
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 48ee7acb87af..8e68f4556962 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -144,7 +144,7 @@ extern struct ata_device *ata_scsi_find_dev(struct ata_port *ap,
extern int ata_scsi_add_hosts(struct ata_host *host,
const struct scsi_host_template *sht);
extern void ata_scsi_scan_host(struct ata_port *ap, int sync);
-extern int ata_scsi_offline_dev(struct ata_device *dev);
+extern bool ata_scsi_offline_dev(struct ata_device *dev);
extern bool ata_scsi_sense_is_valid(u8 sk, u8 asc, u8 ascq);
extern void ata_scsi_set_sense(struct ata_device *dev,
struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq);
--
2.50.0
next prev parent reply other threads:[~2025-06-27 7:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 7:52 [PATCH v2 0/6] Various cleanups Damien Le Moal
2025-06-27 7:52 ` [PATCH v2 1/6] ata: libata: Remove ATA_DFLAG_ZAC device flag Damien Le Moal
2025-06-27 10:53 ` Niklas Cassel
2025-06-27 7:52 ` Damien Le Moal [this message]
2025-06-27 10:53 ` [PATCH v2 2/6] ata: libata-scsi: Cleanup ata_scsi_offline_dev() Niklas Cassel
2025-06-27 7:52 ` [PATCH v2 3/6] ata: Fix SATA_MOBILE_LPM_POLICY description in Kconfig Damien Le Moal
2025-06-27 10:54 ` Niklas Cassel
2025-06-27 7:52 ` [PATCH v2 4/6] ata: libata: Improve LPM policies description Damien Le Moal
2025-06-27 9:08 ` Hannes Reinecke
2025-06-27 10:54 ` Niklas Cassel
2025-06-27 7:52 ` [PATCH v2 5/6] ata: ahci: Clarify mobile_lpm_policy description Damien Le Moal
2025-06-27 10:55 ` Niklas Cassel
2025-06-27 7:52 ` [PATCH v2 6/6] ata: libata-eh: Move and rename ata_eh_set_lpm() Damien Le Moal
2025-06-27 10:55 ` Niklas Cassel
2025-06-30 3:58 ` 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=20250627075207.23969-3-dlemoal@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=hare@suse.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.