public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove unused includes and misleading comments from scsi_lib.c
@ 2002-11-17 22:54 Christoph Hellwig
  2002-11-20 16:47 ` Patrick Mansfield
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2002-11-17 22:54 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi

Some of that stuff might have been right for 2.4, but..

(and btw, scsi_lib is pretty misleading, what about reusing scsi_queue.c?)


--- 1.46/drivers/scsi/scsi_lib.c	Thu Nov 14 18:09:17 2002
+++ edited/drivers/scsi/scsi_lib.c	Sun Nov 17 21:37:05 2002
@@ -7,50 +7,18 @@
  *                        of people at Linux Expo.
  */
 
-/*
- * The fundamental purpose of this file is to contain a library of utility
- * routines that can be used by low-level drivers.   Ultimately the idea
- * is that there should be a sufficiently rich number of functions that it
- * would be possible for a driver author to fashion a queueing function for
- * a low-level driver if they wished.   Note however that this file also
- * contains the "default" versions of these functions, as we don't want to
- * go through and retrofit queueing functions into all 30 some-odd drivers.
- */
-
-#include <linux/module.h>
-
-#include <linux/sched.h>
-#include <linux/timer.h>
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/bio.h>
-#include <linux/ioport.h>
 #include <linux/kernel.h>
-#include <linux/stat.h>
 #include <linux/blk.h>
-#include <linux/interrupt.h>
-#include <linux/delay.h>
-#include <linux/smp_lock.h>
 #include <linux/completion.h>
 
-
-#define __KERNEL_SYSCALLS__
-
-#include <linux/unistd.h>
-
-#include <asm/system.h>
-#include <asm/irq.h>
-#include <asm/dma.h>
-
 #include "scsi.h"
 #include "hosts.h"
 #include <scsi/scsi_ioctl.h>
 
 /*
- * This entire source file deals with the new queueing code.
- */
-
-/*
  * Function:    scsi_insert_special_cmd()
  *
  * Purpose:     Insert pre-formed command into request queue.

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

* Re: [PATCH] remove unused includes and misleading comments from scsi_lib.c
  2002-11-17 22:54 [PATCH] remove unused includes and misleading comments from scsi_lib.c Christoph Hellwig
@ 2002-11-20 16:47 ` Patrick Mansfield
  2002-11-20 17:50   ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick Mansfield @ 2002-11-20 16:47 UTC (permalink / raw)
  To: Christoph Hellwig, James.Bottomley; +Cc: linux-scsi

On Sun, Nov 17, 2002 at 11:54:49PM +0100, Christoph Hellwig wrote:

> --- 1.46/drivers/scsi/scsi_lib.c	Thu Nov 14 18:09:17 2002
> +++ edited/drivers/scsi/scsi_lib.c	Sun Nov 17 21:37:05 2002
> @@ -7,50 +7,18 @@
>   *                        of people at Linux Expo.
>   */
>  
> -/*
> - * The fundamental purpose of this file is to contain a library of utility
> - * routines that can be used by low-level drivers.   Ultimately the idea
> - * is that there should be a sufficiently rich number of functions that it
> - * would be possible for a driver author to fashion a queueing function for
> - * a low-level driver if they wished.   Note however that this file also
> - * contains the "default" versions of these functions, as we don't want to
> - * go through and retrofit queueing functions into all 30 some-odd drivers.
> - */
> -
> -#include <linux/module.h>
> -
> -#include <linux/sched.h>
> -#include <linux/timer.h>
>  #include <linux/string.h>
>  #include <linux/slab.h>
>  #include <linux/bio.h>
> -#include <linux/ioport.h>
>  #include <linux/kernel.h>
> -#include <linux/stat.h>
>  #include <linux/blk.h>
> -#include <linux/interrupt.h>
> -#include <linux/delay.h>
> -#include <linux/smp_lock.h>
>  #include <linux/completion.h>
>  
> -
> -#define __KERNEL_SYSCALLS__
> -
> -#include <linux/unistd.h>

I had to add back the smp_lock.h include to compile with CONFIG_PREEMPT,
as kernel_locked was not defined and is used by in_atomic().

Patch against the latest scsi-misc-2.5:

--- 1.48/drivers/scsi/scsi_lib.c	Tue Nov 19 17:13:41 2002
+++ edited/drivers/scsi/scsi_lib.c	Wed Nov 20 08:33:50 2002
@@ -12,6 +12,7 @@
 #include <linux/bio.h>
 #include <linux/kernel.h>
 #include <linux/blk.h>
+#include <linux/smp_lock.h>
 #include <linux/completion.h>
 
 #include "scsi.h"

-- Patrick Mansfield

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

* Re: [PATCH] remove unused includes and misleading comments from scsi_lib.c
  2002-11-20 16:47 ` Patrick Mansfield
@ 2002-11-20 17:50   ` Christoph Hellwig
  2002-11-20 19:10     ` Patrick Mansfield
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2002-11-20 17:50 UTC (permalink / raw)
  To: Patrick Mansfield; +Cc: James.Bottomley, linux-scsi, linux-kernel

On Wed, Nov 20, 2002 at 08:47:09AM -0800, Patrick Mansfield wrote:
> I had to add back the smp_lock.h include to compile with CONFIG_PREEMPT,
> as kernel_locked was not defined and is used by in_atomic().

Bah.  Any chance you could fix the header declaring in_atomic() to pull
in smp_lock.h by itself instead?

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

* Re: [PATCH] remove unused includes and misleading comments from scsi_lib.c
  2002-11-20 17:50   ` Christoph Hellwig
@ 2002-11-20 19:10     ` Patrick Mansfield
  2002-11-20 19:25       ` J.E.J. Bottomley
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick Mansfield @ 2002-11-20 19:10 UTC (permalink / raw)
  To: Christoph Hellwig, James.Bottomley, linux-scsi, linux-kernel

On Wed, Nov 20, 2002 at 06:50:48PM +0100, Christoph Hellwig wrote:
> On Wed, Nov 20, 2002 at 08:47:09AM -0800, Patrick Mansfield wrote:
> > I had to add back the smp_lock.h include to compile with CONFIG_PREEMPT,
> > as kernel_locked was not defined and is used by in_atomic().
> 
> Bah.  Any chance you could fix the header declaring in_atomic() to pull
> in smp_lock.h by itself instead?

It is in hardirq.h, arch specific, 11 of the 20 hardirq.h files would
need the change (they reference kernel_locked) to include smp_lock.h.

665 files include smp_lock.h
89  files include hardirq.h
32  files include both

So, should I change the arch hardirq.h files to include smp_lock.h,
or just add smp_lock.h to scsi_lib.c?

-- Patrick Mansfield

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

* Re: [PATCH] remove unused includes and misleading comments from scsi_lib.c
  2002-11-20 19:10     ` Patrick Mansfield
@ 2002-11-20 19:25       ` J.E.J. Bottomley
  0 siblings, 0 replies; 5+ messages in thread
From: J.E.J. Bottomley @ 2002-11-20 19:25 UTC (permalink / raw)
  To: Patrick Mansfield
  Cc: Christoph Hellwig, James.Bottomley, linux-scsi, linux-kernel

patmans@us.ibm.com said:
> It is in hardirq.h, arch specific, 11 of the 20 hardirq.h files would
> need the change (they reference kernel_locked) to include smp_lock.h.

> 665 files include smp_lock.h 89  files include hardirq.h 32  files
> include both

> So, should I change the arch hardirq.h files to include smp_lock.h, or
> just add smp_lock.h to scsi_lib.c? 

That magnitude of change needs to go in through the header files project.  
I'll just apply the smp_lock.h in scsi_lib fix to the scsi tree for now.  They 
can always take it out again for the proper fix.

James



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

end of thread, other threads:[~2002-11-20 19:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-17 22:54 [PATCH] remove unused includes and misleading comments from scsi_lib.c Christoph Hellwig
2002-11-20 16:47 ` Patrick Mansfield
2002-11-20 17:50   ` Christoph Hellwig
2002-11-20 19:10     ` Patrick Mansfield
2002-11-20 19:25       ` J.E.J. Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox