All of lore.kernel.org
 help / color / mirror / Atom feed
* ABORT_TASK defined in aic94xx_sas.h
@ 2008-02-06 13:38 Boaz Harrosh
  2008-02-06 15:13 ` James Bottomley
  2008-02-06 20:15 ` Luben Tuikov
  0 siblings, 2 replies; 5+ messages in thread
From: Boaz Harrosh @ 2008-02-06 13:38 UTC (permalink / raw)
  To: linux-scsi, Luben Tuikov

include/scsi/scsi.h as a definition:
#define ABORT_TASK          0x0d

on the other hand drivers/scsi/aic94xx/aic94xx_sas.h has:
#define ABORT_TASK              0x03

am I right in thinking that aic94xx_sas.h is wrong in
polluting the global name-space?

If you ask me aic94xx_sas.h is a global name-space minefield

(This gives me problems when trying to pull in scsi_eh.h into
aic94xx source files)

perhaps:
---
From: Boaz Harrosh <bharrosh@panasas.com>
Date: Wed, 6 Feb 2008 15:35:37 +0200
Subject: [PATCH] aic94xx_sas: avoid conflict with scsi.h

  drivers/scsi/aic94xx/aic94xx_sas.h would redefine ABORT_TASK
  as a different value.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 drivers/scsi/aic94xx/aic94xx_sas.h |    2 +-
 drivers/scsi/aic94xx/aic94xx_tmf.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aic94xx/aic94xx_sas.h b/drivers/scsi/aic94xx/aic94xx_sas.h
index fa7c529..912e6b7 100644
--- a/drivers/scsi/aic94xx/aic94xx_sas.h
+++ b/drivers/scsi/aic94xx/aic94xx_sas.h
@@ -292,7 +292,7 @@ struct scb_header {
 #define INITIATE_SSP_TASK       0x00
 #define INITIATE_LONG_SSP_TASK  0x01
 #define INITIATE_BIDIR_SSP_TASK 0x02
-#define ABORT_TASK              0x03
+#define SCB_ABORT_TASK          0x03
 #define INITIATE_SSP_TMF        0x04
 #define SSP_TARG_GET_DATA       0x05
 #define SSP_TARG_GET_DATA_GOOD  0x06
diff --git a/drivers/scsi/aic94xx/aic94xx_tmf.c b/drivers/scsi/aic94xx/aic94xx_tmf.c
index 87b2f6e..b52124f 100644
--- a/drivers/scsi/aic94xx/aic94xx_tmf.c
+++ b/drivers/scsi/aic94xx/aic94xx_tmf.c
@@ -369,7 +369,7 @@ int asd_abort_task(struct sas_task *task)
 		return -ENOMEM;
 	scb = ascb->scb;
 
-	scb->header.opcode = ABORT_TASK;
+	scb->header.opcode = SCB_ABORT_TASK;
 
 	switch (task->task_proto) {
 	case SAS_PROTOCOL_SATA:
-- 
1.5.3.3


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

* Re: ABORT_TASK defined in aic94xx_sas.h
  2008-02-06 13:38 ABORT_TASK defined in aic94xx_sas.h Boaz Harrosh
@ 2008-02-06 15:13 ` James Bottomley
  2008-02-06 15:34   ` Boaz Harrosh
  2008-02-06 20:15 ` Luben Tuikov
  1 sibling, 1 reply; 5+ messages in thread
From: James Bottomley @ 2008-02-06 15:13 UTC (permalink / raw)
  To: Boaz Harrosh; +Cc: linux-scsi, Luben Tuikov

On Wed, 2008-02-06 at 15:38 +0200, Boaz Harrosh wrote:
> include/scsi/scsi.h as a definition:
> #define ABORT_TASK          0x0d
> 
> on the other hand drivers/scsi/aic94xx/aic94xx_sas.h has:
> #define ABORT_TASK              0x03
> 
> am I right in thinking that aic94xx_sas.h is wrong in
> polluting the global name-space?
> 
> If you ask me aic94xx_sas.h is a global name-space minefield
> 
> (This gives me problems when trying to pull in scsi_eh.h into
> aic94xx source files)

Well, no, not in those terms.  The global namespace exists in shared
headers which it's a little hard to argue that aic94xx_sas.h is, being
unusable by anything other than a single driver.

It is correct to say that include/scsi/scsi.h is polluting the global
namespace, because that is pulled into a large section of the kernel.

The message code #defines in scsi.h are a horrible mess of SPI message
defines and task management function defines each of which should
arguably have a SPI_ and TMF_ global namespace discriminator (and the
SPI_ ones be shovelled off into the SPI transport class header).

However, this looks like a reasonable hack.

James



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

* Re: ABORT_TASK defined in aic94xx_sas.h
  2008-02-06 15:13 ` James Bottomley
@ 2008-02-06 15:34   ` Boaz Harrosh
  2008-02-06 15:46     ` James Bottomley
  0 siblings, 1 reply; 5+ messages in thread
From: Boaz Harrosh @ 2008-02-06 15:34 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, Luben Tuikov

On Wed, Feb 06 2008 at 17:13 +0200, James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
> On Wed, 2008-02-06 at 15:38 +0200, Boaz Harrosh wrote:
>> include/scsi/scsi.h as a definition:
>> #define ABORT_TASK          0x0d
>>
>> on the other hand drivers/scsi/aic94xx/aic94xx_sas.h has:
>> #define ABORT_TASK              0x03
>>
>> am I right in thinking that aic94xx_sas.h is wrong in
>> polluting the global name-space?
>>
>> If you ask me aic94xx_sas.h is a global name-space minefield
>>
>> (This gives me problems when trying to pull in scsi_eh.h into
>> aic94xx source files)
> 
> Well, no, not in those terms.  The global namespace exists in shared
> headers which it's a little hard to argue that aic94xx_sas.h is, being
> unusable by anything other than a single driver.
> 
> It is correct to say that include/scsi/scsi.h is polluting the global
> namespace, because that is pulled into a large section of the kernel.
> 
> The message code #defines in scsi.h are a horrible mess of SPI message
> defines and task management function defines each of which should
> arguably have a SPI_ and TMF_ global namespace discriminator (and the
> SPI_ ones be shovelled off into the SPI transport class header).
> 
> However, this looks like a reasonable hack.
> 
> James
> 
> 
Point taken, you are right.

Please see that you approve of the name I gave it,
I just got it from the nearest comment so I'm not
even sure if it's related.

Thanks
Boaz


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

* Re: ABORT_TASK defined in aic94xx_sas.h
  2008-02-06 15:34   ` Boaz Harrosh
@ 2008-02-06 15:46     ` James Bottomley
  0 siblings, 0 replies; 5+ messages in thread
From: James Bottomley @ 2008-02-06 15:46 UTC (permalink / raw)
  To: Boaz Harrosh; +Cc: linux-scsi, Luben Tuikov

On Wed, 2008-02-06 at 17:34 +0200, Boaz Harrosh wrote:
> On Wed, Feb 06 2008 at 17:13 +0200, James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
> > On Wed, 2008-02-06 at 15:38 +0200, Boaz Harrosh wrote:
> >> include/scsi/scsi.h as a definition:
> >> #define ABORT_TASK          0x0d
> >>
> >> on the other hand drivers/scsi/aic94xx/aic94xx_sas.h has:
> >> #define ABORT_TASK              0x03
> >>
> >> am I right in thinking that aic94xx_sas.h is wrong in
> >> polluting the global name-space?
> >>
> >> If you ask me aic94xx_sas.h is a global name-space minefield
> >>
> >> (This gives me problems when trying to pull in scsi_eh.h into
> >> aic94xx source files)
> > 
> > Well, no, not in those terms.  The global namespace exists in shared
> > headers which it's a little hard to argue that aic94xx_sas.h is, being
> > unusable by anything other than a single driver.
> > 
> > It is correct to say that include/scsi/scsi.h is polluting the global
> > namespace, because that is pulled into a large section of the kernel.
> > 
> > The message code #defines in scsi.h are a horrible mess of SPI message
> > defines and task management function defines each of which should
> > arguably have a SPI_ and TMF_ global namespace discriminator (and the
> > SPI_ ones be shovelled off into the SPI transport class header).
> > 
> > However, this looks like a reasonable hack.
> > 
> > James
> > 
> > 
> Point taken, you are right.
> 
> Please see that you approve of the name I gave it,
> I just got it from the nearest comment so I'm not
> even sure if it's related.

Yes, it's a sequencer control block opcode, so prefixing it with SCB_ is
reasonable.

James



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

* Re: ABORT_TASK defined in aic94xx_sas.h
  2008-02-06 13:38 ABORT_TASK defined in aic94xx_sas.h Boaz Harrosh
  2008-02-06 15:13 ` James Bottomley
@ 2008-02-06 20:15 ` Luben Tuikov
  1 sibling, 0 replies; 5+ messages in thread
From: Luben Tuikov @ 2008-02-06 20:15 UTC (permalink / raw)
  To: linux-scsi, Luben Tuikov, Boaz Harrosh

--- On Wed, 2/6/08, Boaz Harrosh <bharrosh@panasas.com> wrote:
> include/scsi/scsi.h as a definition:
> #define ABORT_TASK          0x0d
> 
> on the other hand drivers/scsi/aic94xx/aic94xx_sas.h has:
> #define ABORT_TASK              0x03
> 
> am I right in thinking that aic94xx_sas.h is wrong in
> polluting the global name-space?
> 
> If you ask me aic94xx_sas.h is a global name-space
> minefield

LOL, "global name-space minefield" -- that's funny.

Yeah, I didn't think the aic94xx_sas.h would be
used the way it is (or that the SAS Stack would become
a "pimple" as opposed to a layer as originally defined).

In macro name definitions, I tried to stay as close
as possible to the specs of the chip.

Anyway, I ack this patch. See below.

(Maybe scsi.h::ABORT_TASK should go away for the better
defined scsi.h::TMF_ABORT_TASK.)

> 
> (This gives me problems when trying to pull in scsi_eh.h
> into
> aic94xx source files)
> 
> perhaps:
> ---
> From: Boaz Harrosh <bharrosh@panasas.com>
> Date: Wed, 6 Feb 2008 15:35:37 +0200
> Subject: [PATCH] aic94xx_sas: avoid conflict with scsi.h
> 
>   drivers/scsi/aic94xx/aic94xx_sas.h would redefine
> ABORT_TASK
>   as a different value.
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>

Acked-by: Luben Tuikov <ltuikov@yahoo.com>

   Luben


> ---
>  drivers/scsi/aic94xx/aic94xx_sas.h |    2 +-
>  drivers/scsi/aic94xx/aic94xx_tmf.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/aic94xx/aic94xx_sas.h
> b/drivers/scsi/aic94xx/aic94xx_sas.h
> index fa7c529..912e6b7 100644
> --- a/drivers/scsi/aic94xx/aic94xx_sas.h
> +++ b/drivers/scsi/aic94xx/aic94xx_sas.h
> @@ -292,7 +292,7 @@ struct scb_header {
>  #define INITIATE_SSP_TASK       0x00
>  #define INITIATE_LONG_SSP_TASK  0x01
>  #define INITIATE_BIDIR_SSP_TASK 0x02
> -#define ABORT_TASK              0x03
> +#define SCB_ABORT_TASK          0x03
>  #define INITIATE_SSP_TMF        0x04
>  #define SSP_TARG_GET_DATA       0x05
>  #define SSP_TARG_GET_DATA_GOOD  0x06
> diff --git a/drivers/scsi/aic94xx/aic94xx_tmf.c
> b/drivers/scsi/aic94xx/aic94xx_tmf.c
> index 87b2f6e..b52124f 100644
> --- a/drivers/scsi/aic94xx/aic94xx_tmf.c
> +++ b/drivers/scsi/aic94xx/aic94xx_tmf.c
> @@ -369,7 +369,7 @@ int asd_abort_task(struct sas_task
> *task)
>  		return -ENOMEM;
>  	scb = ascb->scb;
>  
> -	scb->header.opcode = ABORT_TASK;
> +	scb->header.opcode = SCB_ABORT_TASK;
>  
>  	switch (task->task_proto) {
>  	case SAS_PROTOCOL_SATA:
> -- 
> 1.5.3.3
> 
> -
> 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

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

end of thread, other threads:[~2008-02-06 20:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-06 13:38 ABORT_TASK defined in aic94xx_sas.h Boaz Harrosh
2008-02-06 15:13 ` James Bottomley
2008-02-06 15:34   ` Boaz Harrosh
2008-02-06 15:46     ` James Bottomley
2008-02-06 20:15 ` Luben Tuikov

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.