[SRU][Xenial][PATCH 3/4] scsi: sas: provide stub implementation for scsi_is_sas_rphy

Joseph Salisbury joseph.salisbury at canonical.com
Wed Sep 20 19:12:55 UTC 2017


From: Johannes Thumshirn <jthumshirn at suse.de>

BugLink: http://bugs.launchpad.net/bugs/1693369

Provide a stub implementation for scsi_is_sas_rphy for kernel
configurations which do not have CONFIG_SCSI_SAS_ATTRS defined.

Reported-by: kbuild test robot <lkp at intel.com>
Suggested-by: James Bottomley <jejb at linux.vnet.ibm.com>
Reviewed-by: James E.J. Bottomley <jejb at linux.vnet.ibm.com>
Signed-off-by: Johannes Thumshirn <jthumshirn at suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
(back ported from commit c1a23f6d64552b4480208aa584ec7e9c13d6d9c3)
Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
---
 include/scsi/scsi_transport_sas.h | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 140eeee..31ae074 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -10,6 +10,21 @@ struct scsi_transport_template;
 struct sas_rphy;
 struct request;
 
+#if !IS_ENABLED(CONFIG_SCSI_SAS_ATTRS)
+static inline int is_sas_attached(struct scsi_device *sdev)
+{
+	return 0;
+}
+
+static inline int scsi_is_sas_rphy(const struct device *sdev)
+{
+	return 0;
+}
+#else
+extern int is_sas_attached(struct scsi_device *sdev);
+extern int scsi_is_sas_rphy(const struct device *);
+#endif
+
 static inline int sas_protocol_ata(enum sas_protocol proto)
 {
 	return ((proto & SAS_PROTOCOL_SATA) ||
@@ -193,7 +208,6 @@ extern int sas_rphy_add(struct sas_rphy *);
 extern void sas_rphy_remove(struct sas_rphy *);
 extern void sas_rphy_delete(struct sas_rphy *);
 extern void sas_rphy_unlink(struct sas_rphy *);
-extern int scsi_is_sas_rphy(const struct device *);
 
 struct sas_port *sas_port_alloc(struct device *, int);
 struct sas_port *sas_port_alloc_num(struct device *);
-- 
2.7.4





More information about the kernel-team mailing list