All of lore.kernel.org
 help / color / mirror / Atom feed
* scsi: include linux/scatterlist.h to pick up ARCH_HAS_SG_CHAIN
@ 2011-01-16 20:12 David Dillow
  2011-01-17  9:43 ` Boaz Harrosh
  0 siblings, 1 reply; 3+ messages in thread
From: David Dillow @ 2011-01-16 20:12 UTC (permalink / raw)
  To: linux-scsi; +Cc: linux-kernel, James.Bottomley

If the compiled object doesn't include linux/scatterlist.h before
scsi/scsi.h, it will get an incorrect definition of
SCSI_MAX_SG_CHAIN_SEGMENTS.

Signed-off-by: David Dillow <dillowda@ornl.gov>
--
This fixes an issue I found while working on the SRP initiator, where
linux/scatterlist.h was being pulled in by scsi/scsi_device.h. It's not
clear if I'm supposed to include linux/scatterlist.h myself, or if I'm
including the scsi headers in the wrong order. It makes sense for me
that scsi.h would pickup the needed headers itself to prevent confusion.

Another option is to potentially get rid of the ARCH_HAS_SG_CHAIN define
as all archs have it save m68knommu.


diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 648d233..b76d400 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -9,6 +9,7 @@
 #define _SCSI_SCSI_H
 
 #include <linux/types.h>
+#include <linux/scatterlist.h>
 
 struct scsi_cmnd;
 



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

* Re: scsi: include linux/scatterlist.h to pick up ARCH_HAS_SG_CHAIN
  2011-01-16 20:12 scsi: include linux/scatterlist.h to pick up ARCH_HAS_SG_CHAIN David Dillow
@ 2011-01-17  9:43 ` Boaz Harrosh
  2011-01-18  2:50   ` David Dillow
  0 siblings, 1 reply; 3+ messages in thread
From: Boaz Harrosh @ 2011-01-17  9:43 UTC (permalink / raw)
  To: David Dillow; +Cc: linux-scsi, linux-kernel, James.Bottomley

On 01/16/2011 10:12 PM, David Dillow wrote:
> If the compiled object doesn't include linux/scatterlist.h before
> scsi/scsi.h, it will get an incorrect definition of
> SCSI_MAX_SG_CHAIN_SEGMENTS.
> 
> Signed-off-by: David Dillow <dillowda@ornl.gov>
> --
> This fixes an issue I found while working on the SRP initiator, where
> linux/scatterlist.h was being pulled in by scsi/scsi_device.h. It's not
> clear if I'm supposed to include linux/scatterlist.h myself, or if I'm
> including the scsi headers in the wrong order. It makes sense for me
> that scsi.h would pickup the needed headers itself to prevent confusion.
> 

I totally agree. This below is the proper fix!

> Another option is to potentially get rid of the ARCH_HAS_SG_CHAIN define
> as all archs have it save m68knommu.
> 

What's preventing m68knommu from chaining? this is pure C manipulations,
what am I missing?

Thanks for catching this. As is, it is vary dangerous. I wonder where
else did it hit unnoticed?

Boaz

> 
> diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
> index 648d233..b76d400 100644
> --- a/include/scsi/scsi.h
> +++ b/include/scsi/scsi.h
> @@ -9,6 +9,7 @@
>  #define _SCSI_SCSI_H
>  
>  #include <linux/types.h>
> +#include <linux/scatterlist.h>
>  
>  struct scsi_cmnd;
>  
> 

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

* Re: scsi: include linux/scatterlist.h to pick up ARCH_HAS_SG_CHAIN
  2011-01-17  9:43 ` Boaz Harrosh
@ 2011-01-18  2:50   ` David Dillow
  0 siblings, 0 replies; 3+ messages in thread
From: David Dillow @ 2011-01-18  2:50 UTC (permalink / raw)
  To: Boaz Harrosh; +Cc: linux-scsi, linux-kernel, James.Bottomley

On Mon, 2011-01-17 at 11:43 +0200, Boaz Harrosh wrote:
> > Another option is to potentially get rid of the ARCH_HAS_SG_CHAIN define
> > as all archs have it save m68knommu.
> 
> What's preventing m68knommu from chaining? this is pure C manipulations,
> what am I missing?

Hopefully someone else will know -- I didn't look very hard once I saw
that it had no arch-specific asm include directory that I could readily
find.

Thanks for taking a look,
-- 
Dave Dillow
National Center for Computational Science
Oak Ridge National Laboratory
(865) 241-6602 office


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

end of thread, other threads:[~2011-01-18  2:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-16 20:12 scsi: include linux/scatterlist.h to pick up ARCH_HAS_SG_CHAIN David Dillow
2011-01-17  9:43 ` Boaz Harrosh
2011-01-18  2:50   ` David Dillow

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.