summaryrefslogtreecommitdiff
path: root/include/scsi/sas_ata.h
diff options
context:
space:
mode:
authorJason Yan <yanaijie@huawei.com>2022-12-14 21:38:05 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2022-12-30 16:59:10 +0000
commitffebb38efee3e6bbcccd0b7babf0ede8890794cd (patch)
tree2dd302ca8345ae4e157614cd4c87e8217de3e78d /include/scsi/sas_ata.h
parent6c90466e2803d93ed47a980fbf184d35e012d895 (diff)
scsi: libsas: Change the coding style of sas_discover_sata()
The coding style where calling this interface is inconsistent with other interfaces for SATA devices. The standard style for other SATA interfaces is like: #ifdefine CONFIG_SCSI_SAS_ATA void sas_ata_task_abort(struct sas_task *task); #else static inline void sas_ata_task_abort(struct sas_task *task) { } #endif And the callers does not have to do things like "#ifdefine CONFIG_SCSI_SAS_ATA" and may call the interface directly. So follow the standard style here. Cc: John Garry <john.g.garry@oracle.com> Signed-off-by: Jason Yan <yanaijie@huawei.com> Reviewed-by: Jack Wang <jinpu.wang@ionos.com> Reviewed-by: John Garry <john.g.garry@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/scsi/sas_ata.h')
-rw-r--r--include/scsi/sas_ata.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h
index 9c927d46f136..606b4496ecaf 100644
--- a/include/scsi/sas_ata.h
+++ b/include/scsi/sas_ata.h
@@ -36,8 +36,13 @@ void sas_ata_device_link_abort(struct domain_device *dev, bool force_reset);
int sas_execute_ata_cmd(struct domain_device *device, u8 *fis,
int force_phy_id);
int smp_ata_check_ready_type(struct ata_link *link);
+int sas_discover_sata(struct domain_device *dev);
#else
+static inline void sas_ata_disabled_notice(void)
+{
+ pr_notice_once("ATA device seen but CONFIG_SCSI_SAS_ATA=N\n");
+}
static inline int dev_is_sata(struct domain_device *dev)
{
@@ -103,6 +108,12 @@ static inline int smp_ata_check_ready_type(struct ata_link *link)
{
return 0;
}
+
+static inline int sas_discover_sata(struct domain_device *dev)
+{
+ sas_ata_disabled_notice();
+ return -ENXIO;
+}
#endif
#endif /* _SAS_ATA_H_ */