All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached
@ 2016-08-15  8:52 Johannes Thumshirn
  2016-08-15  8:52 ` [PATCH 2/2] sas: remove is_sas_attached() Johannes Thumshirn
  2016-08-15 14:11   ` kbuild test robot
  0 siblings, 2 replies; 10+ messages in thread
From: Johannes Thumshirn @ 2016-08-15  8:52 UTC (permalink / raw)
  To: James Bottomley, Martin K . Petersen
  Cc: Hannes Reinecke, Linux Kernel Mailinglist,
	Linux SCSI Mailinglist, Johannes Thumshirn, stable, #, v4.5+

Use scsi_is_sas_rphy() instead of is_sas_attached() to decide whether
we should obtain the SAS address from a scsi device or not. This will
prevent us from tripping on the BUG_ON() in sas_sdev_to_rdev() if the
rphy isn't attached to the SAS transport class, like it is with hpsa's
logical devices.

Fixes: 3f8d6f2a0 ('ses: fix discovery of SATA devices in SAS enclosures')
Cc: stable@vger.kernel.org # v4.5+
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/scsi/ses.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index 53ef1cb6..1d82053 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -587,7 +587,7 @@ static void ses_match_to_enclosure(struct enclosure_device *edev,
 
 	ses_enclosure_data_process(edev, to_scsi_device(edev->edev.parent), 0);
 
-	if (is_sas_attached(sdev))
+	if (scsi_is_sas_rphy(&sdev->sdev_gendev))
 		efd.addr = sas_get_address(sdev);
 
 	if (efd.addr) {
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] sas: remove is_sas_attached()
  2016-08-15  8:52 [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached Johannes Thumshirn
@ 2016-08-15  8:52 ` Johannes Thumshirn
  2016-08-15 14:11   ` kbuild test robot
  1 sibling, 0 replies; 10+ messages in thread
From: Johannes Thumshirn @ 2016-08-15  8:52 UTC (permalink / raw)
  To: James Bottomley, Martin K . Petersen
  Cc: Hannes Reinecke, Linux Kernel Mailinglist,
	Linux SCSI Mailinglist, Johannes Thumshirn

As there are no more users of is_sas_attached() left, remove it.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/scsi/scsi_transport_sas.c | 16 ----------------
 include/scsi/scsi_transport_sas.h |  9 ---------
 2 files changed, 25 deletions(-)

diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 3f0ff07..60b651b 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -341,22 +341,6 @@ static int do_sas_phy_delete(struct device *dev, void *data)
 }
 
 /**
- * is_sas_attached - check if device is SAS attached
- * @sdev: scsi device to check
- *
- * returns true if the device is SAS attached
- */
-int is_sas_attached(struct scsi_device *sdev)
-{
-	struct Scsi_Host *shost = sdev->host;
-
-	return shost->transportt->host_attrs.ac.class ==
-		&sas_host_class.class;
-}
-EXPORT_SYMBOL(is_sas_attached);
-
-
-/**
  * sas_remove_children  -  tear down a devices SAS data structures
  * @dev:	device belonging to the sas object
  *
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 13c0b2b..140eeee 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -10,15 +10,6 @@ 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;
-}
-#else
-extern int is_sas_attached(struct scsi_device *sdev);
-#endif
-
 static inline int sas_protocol_ata(enum sas_protocol proto)
 {
 	return ((proto & SAS_PROTOCOL_SATA) ||
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached
  2016-08-15  8:52 [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached Johannes Thumshirn
@ 2016-08-15 14:11   ` kbuild test robot
  2016-08-15 14:11   ` kbuild test robot
  1 sibling, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2016-08-15 14:11 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: kbuild-all, James Bottomley, Martin K . Petersen,
	Hannes Reinecke, Linux Kernel Mailinglist,
	Linux SCSI Mailinglist, Johannes Thumshirn, stable, #, v4.5+

[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]

Hi Johannes,

[auto build test ERROR on scsi/for-next]
[also build test ERROR on v4.8-rc2 next-20160815]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Johannes-Thumshirn/ses-use-scsi_is_sas_rphy-instead-of-is_sas_attached/20160815-165716
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: s390-zfcpdump_defconfig (attached as .config)
compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=s390 

All errors (new ones prefixed by >>):

   drivers/built-in.o: In function `ses_match_to_enclosure':
>> drivers/scsi/ses.c:590: undefined reference to `scsi_is_sas_rphy'
>> drivers/scsi/ses.c:591: undefined reference to `sas_get_address'

vim +590 drivers/scsi/ses.c

   584		struct efd efd = {
   585			.addr = 0,
   586		};
   587	
   588		ses_enclosure_data_process(edev, to_scsi_device(edev->edev.parent), 0);
   589	
 > 590		if (scsi_is_sas_rphy(&sdev->sdev_gendev))
 > 591			efd.addr = sas_get_address(sdev);
   592	
   593		if (efd.addr) {
   594			efd.dev = &sdev->sdev_gendev;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 6975 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached
@ 2016-08-15 14:11   ` kbuild test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2016-08-15 14:11 UTC (permalink / raw)
  Cc: kbuild-all, James Bottomley, Martin K . Petersen,
	Hannes Reinecke, Linux Kernel Mailinglist,
	Linux SCSI Mailinglist, Johannes Thumshirn, stable, #, v4.5+

[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]

Hi Johannes,

[auto build test ERROR on scsi/for-next]
[also build test ERROR on v4.8-rc2 next-20160815]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Johannes-Thumshirn/ses-use-scsi_is_sas_rphy-instead-of-is_sas_attached/20160815-165716
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: s390-zfcpdump_defconfig (attached as .config)
compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=s390 

All errors (new ones prefixed by >>):

   drivers/built-in.o: In function `ses_match_to_enclosure':
>> drivers/scsi/ses.c:590: undefined reference to `scsi_is_sas_rphy'
>> drivers/scsi/ses.c:591: undefined reference to `sas_get_address'

vim +590 drivers/scsi/ses.c

   584		struct efd efd = {
   585			.addr = 0,
   586		};
   587	
   588		ses_enclosure_data_process(edev, to_scsi_device(edev->edev.parent), 0);
   589	
 > 590		if (scsi_is_sas_rphy(&sdev->sdev_gendev))
 > 591			efd.addr = sas_get_address(sdev);
   592	
   593		if (efd.addr) {
   594			efd.dev = &sdev->sdev_gendev;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 6975 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached
  2016-08-15 14:11   ` kbuild test robot
  (?)
@ 2016-08-15 14:25   ` James Bottomley
  2016-08-15 14:40       ` Johannes Thumshirn
  -1 siblings, 1 reply; 10+ messages in thread
From: James Bottomley @ 2016-08-15 14:25 UTC (permalink / raw)
  To: kbuild test robot, Johannes Thumshirn
  Cc: kbuild-all, Martin K . Petersen, Hannes Reinecke,
	Linux Kernel Mailinglist, Linux SCSI Mailinglist, stable, #,
	v4.5+

On Mon, 2016-08-15 at 22:11 +0800, kbuild test robot wrote:
> Hi Johannes,
> 
> [auto build test ERROR on scsi/for-next]
> [also build test ERROR on v4.8-rc2 next-20160815]
> [if your patch is applied to the wrong git tree, please drop us a 
> note to help improve the system]

This is happening because scsi_is_sas_rphy wasn't designed to be used
outside the SAS transport class, so it's failing when the ATTRs aren't
defined.

This is the way you fix it (needs to be a precursor patch to 1/2):

James

---

diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 13c0b2b..0e1c50e 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -15,8 +15,13 @@ static inline int is_sas_attached(struct scsi_device *sdev)
 {
 	return 0;
 }
+static inline int scsi_is_sas_rphy(const struct device *)
+{
+	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)
@@ -202,7 +207,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 *);

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached
  2016-08-15 14:25   ` James Bottomley
@ 2016-08-15 14:40       ` Johannes Thumshirn
  0 siblings, 0 replies; 10+ messages in thread
From: Johannes Thumshirn @ 2016-08-15 14:40 UTC (permalink / raw)
  To: James Bottomley
  Cc: kbuild test robot, kbuild-all, Martin K . Petersen,
	Hannes Reinecke, Linux Kernel Mailinglist,
	Linux SCSI Mailinglist, stable, #, v4.5+

On Mon, Aug 15, 2016 at 07:25:53AM -0700, James Bottomley wrote:
> On Mon, 2016-08-15 at 22:11 +0800, kbuild test robot wrote:
> > Hi Johannes,
> > 
> > [auto build test ERROR on scsi/for-next]
> > [also build test ERROR on v4.8-rc2 next-20160815]
> > [if your patch is applied to the wrong git tree, please drop us a 
> > note to help improve the system]
> 
> This is happening because scsi_is_sas_rphy wasn't designed to be used
> outside the SAS transport class, so it's failing when the ATTRs aren't
> defined.
> 
> This is the way you fix it (needs to be a precursor patch to 1/2):
> 
> James

Thanks, but I'm wondering about the call to sas_get_address(). It was
there before the patch as well and now it's an undefined reference. Am
I missing something here? Sure it can be guarded in the #if block.

> 
> ---
> 
> diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
> index 13c0b2b..0e1c50e 100644
> --- a/include/scsi/scsi_transport_sas.h
> +++ b/include/scsi/scsi_transport_sas.h
> @@ -15,8 +15,13 @@ static inline int is_sas_attached(struct scsi_device *sdev)
>  {
>  	return 0;
>  }
> +static inline int scsi_is_sas_rphy(const struct device *)
> +{
> +	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)
> @@ -202,7 +207,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 *);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached
@ 2016-08-15 14:40       ` Johannes Thumshirn
  0 siblings, 0 replies; 10+ messages in thread
From: Johannes Thumshirn @ 2016-08-15 14:40 UTC (permalink / raw)
  To: James Bottomley
  Cc: kbuild test robot, kbuild-all, Martin K . Petersen,
	Hannes Reinecke, Linux Kernel Mailinglist,
	Linux SCSI Mailinglist, stable, #, v4.5+

On Mon, Aug 15, 2016 at 07:25:53AM -0700, James Bottomley wrote:
> On Mon, 2016-08-15 at 22:11 +0800, kbuild test robot wrote:
> > Hi Johannes,
> > 
> > [auto build test ERROR on scsi/for-next]
> > [also build test ERROR on v4.8-rc2 next-20160815]
> > [if your patch is applied to the wrong git tree, please drop us a 
> > note to help improve the system]
> 
> This is happening because scsi_is_sas_rphy wasn't designed to be used
> outside the SAS transport class, so it's failing when the ATTRs aren't
> defined.
> 
> This is the way you fix it (needs to be a precursor patch to 1/2):
> 
> James

Thanks, but I'm wondering about the call to sas_get_address(). It was
there before the patch as well and now it's an undefined reference. Am
I missing something here? Sure it can be guarded in the #if block.

> 
> ---
> 
> diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
> index 13c0b2b..0e1c50e 100644
> --- a/include/scsi/scsi_transport_sas.h
> +++ b/include/scsi/scsi_transport_sas.h
> @@ -15,8 +15,13 @@ static inline int is_sas_attached(struct scsi_device *sdev)
>  {
>  	return 0;
>  }
> +static inline int scsi_is_sas_rphy(const struct device *)
> +{
> +	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)
> @@ -202,7 +207,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 *);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N�rnberg
GF: Felix Imend�rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N�rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached
  2016-08-15 14:40       ` Johannes Thumshirn
  (?)
@ 2016-08-15 14:59       ` James Bottomley
  2016-08-15 15:04           ` Johannes Thumshirn
  -1 siblings, 1 reply; 10+ messages in thread
From: James Bottomley @ 2016-08-15 14:59 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: kbuild test robot, kbuild-all, Martin K . Petersen,
	Hannes Reinecke, Linux Kernel Mailinglist,
	Linux SCSI Mailinglist, stable

On Mon, 2016-08-15 at 16:40 +0200, Johannes Thumshirn wrote:
> On Mon, Aug 15, 2016 at 07:25:53AM -0700, James Bottomley wrote:
> > On Mon, 2016-08-15 at 22:11 +0800, kbuild test robot wrote:
> > > Hi Johannes,
> > > 
> > > [auto build test ERROR on scsi/for-next]
> > > [also build test ERROR on v4.8-rc2 next-20160815]
> > > [if your patch is applied to the wrong git tree, please drop us a
> > > note to help improve the system]
> > 
> > This is happening because scsi_is_sas_rphy wasn't designed to be 
> > used outside the SAS transport class, so it's failing when the 
> > ATTRs aren't defined.
> > 
> > This is the way you fix it (needs to be a precursor patch to 1/2):
> > 
> > James
> 
> Thanks, but I'm wondering about the call to sas_get_address(). It was
> there before the patch as well and now it's an undefined reference. 
> Am I missing something here? Sure it can be guarded in the #if block.

Yes: gcc is kind enough to elide any code that looks like

if (0) {
	refer to something
}

So the static inline ensures anything within the brace isn't used as a
linkable reference.

James

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached
  2016-08-15 14:59       ` James Bottomley
@ 2016-08-15 15:04           ` Johannes Thumshirn
  0 siblings, 0 replies; 10+ messages in thread
From: Johannes Thumshirn @ 2016-08-15 15:04 UTC (permalink / raw)
  To: James Bottomley
  Cc: kbuild test robot, kbuild-all, Martin K . Petersen,
	Hannes Reinecke, Linux Kernel Mailinglist,
	Linux SCSI Mailinglist, stable

On Mon, Aug 15, 2016 at 07:59:25AM -0700, James Bottomley wrote:
> On Mon, 2016-08-15 at 16:40 +0200, Johannes Thumshirn wrote:
> > On Mon, Aug 15, 2016 at 07:25:53AM -0700, James Bottomley wrote:
> > > On Mon, 2016-08-15 at 22:11 +0800, kbuild test robot wrote:
> > > > Hi Johannes,
> > > > 
> > > > [auto build test ERROR on scsi/for-next]
> > > > [also build test ERROR on v4.8-rc2 next-20160815]
> > > > [if your patch is applied to the wrong git tree, please drop us a
> > > > note to help improve the system]
> > > 
> > > This is happening because scsi_is_sas_rphy wasn't designed to be 
> > > used outside the SAS transport class, so it's failing when the 
> > > ATTRs aren't defined.
> > > 
> > > This is the way you fix it (needs to be a precursor patch to 1/2):
> > > 
> > > James
> > 
> > Thanks, but I'm wondering about the call to sas_get_address(). It was
> > there before the patch as well and now it's an undefined reference. 
> > Am I missing something here? Sure it can be guarded in the #if block.
> 
> Yes: gcc is kind enough to elide any code that looks like
> 
> if (0) {
> 	refer to something
> }
> 
> So the static inline ensures anything within the brace isn't used as a
> linkable reference.

Aaahhh, that explains a lot.

Anyways, I've included get_sas_address() in the ifdef guard and
compile tested the new series with and with out
CONFIG_SCSI_SAS_ATTRS. Will send out shortly.

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached
@ 2016-08-15 15:04           ` Johannes Thumshirn
  0 siblings, 0 replies; 10+ messages in thread
From: Johannes Thumshirn @ 2016-08-15 15:04 UTC (permalink / raw)
  To: James Bottomley
  Cc: kbuild test robot, kbuild-all, Martin K . Petersen,
	Hannes Reinecke, Linux Kernel Mailinglist,
	Linux SCSI Mailinglist, stable

On Mon, Aug 15, 2016 at 07:59:25AM -0700, James Bottomley wrote:
> On Mon, 2016-08-15 at 16:40 +0200, Johannes Thumshirn wrote:
> > On Mon, Aug 15, 2016 at 07:25:53AM -0700, James Bottomley wrote:
> > > On Mon, 2016-08-15 at 22:11 +0800, kbuild test robot wrote:
> > > > Hi Johannes,
> > > > 
> > > > [auto build test ERROR on scsi/for-next]
> > > > [also build test ERROR on v4.8-rc2 next-20160815]
> > > > [if your patch is applied to the wrong git tree, please drop us a
> > > > note to help improve the system]
> > > 
> > > This is happening because scsi_is_sas_rphy wasn't designed to be 
> > > used outside the SAS transport class, so it's failing when the 
> > > ATTRs aren't defined.
> > > 
> > > This is the way you fix it (needs to be a precursor patch to 1/2):
> > > 
> > > James
> > 
> > Thanks, but I'm wondering about the call to sas_get_address(). It was
> > there before the patch as well and now it's an undefined reference. 
> > Am I missing something here? Sure it can be guarded in the #if block.
> 
> Yes: gcc is kind enough to elide any code that looks like
> 
> if (0) {
> 	refer to something
> }
> 
> So the static inline ensures anything within the brace isn't used as a
> linkable reference.

Aaahhh, that explains a lot.

Anyways, I've included get_sas_address() in the ifdef guard and
compile tested the new series with and with out
CONFIG_SCSI_SAS_ATTRS. Will send out shortly.

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N�rnberg
GF: Felix Imend�rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N�rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-08-15 15:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-15  8:52 [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached Johannes Thumshirn
2016-08-15  8:52 ` [PATCH 2/2] sas: remove is_sas_attached() Johannes Thumshirn
2016-08-15 14:11 ` [PATCH 1/2] ses: use scsi_is_sas_rphy instead of is_sas_attached kbuild test robot
2016-08-15 14:11   ` kbuild test robot
2016-08-15 14:25   ` James Bottomley
2016-08-15 14:40     ` Johannes Thumshirn
2016-08-15 14:40       ` Johannes Thumshirn
2016-08-15 14:59       ` James Bottomley
2016-08-15 15:04         ` Johannes Thumshirn
2016-08-15 15:04           ` Johannes Thumshirn

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.