Re: [patch 02/25] drivers/scsi/advansys.c: cleanups

2007-05-24 Thread Christoph Hellwig
On Wed, May 23, 2007 at 08:22:07PM -0500, James Bottomley wrote:
 On Wed, 2007-05-23 at 16:33 -0700, Andrew Morton wrote:
  On Wed, 23 May 2007 18:21:31 -0500
  James Bottomley [EMAIL PROTECTED] wrote:
  
   On Wed, 2007-05-23 at 14:41 -0700, [EMAIL PROTECTED] wrote:
From: Adrian Bunk [EMAIL PROTECTED]

- remove the unneeded advansys.h
- remove the unused advansys_setup()
   
   This isn't quite right, though, is it?  advansys_setup() should be used.
   
   It looks like there was a bogus conversion away from init/main.c which
   left the function dangling.  Isn't the correct thing to do to wire it up
   in advansys_detect() which is where it should have been in the first
   place.
   
  
  Even going back to linux-2.4.2 I can find no caller to advansys_setup(). 
  Or was its call buried in the magical template macros?
 
 If I remember rightly, the bootsetups[] array was a 2.0 thing it became
 kernel_param in 2.1.75.  It was gone by 2.4.0, so this removal thing
 must have been in the 2.3 timeframe.
 
 Still ... it can be put back .. it looks basically sound.

I don't think we should put it back, obviously no ones has missed
it for te last 10 years.  If we really want boot paramaters for
advansys it should be using module_param, not a 10 year old legacy
interface.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 02/25] drivers/scsi/advansys.c: cleanups

2007-05-23 Thread akpm
From: Adrian Bunk [EMAIL PROTECTED]

- remove the unneeded advansys.h
- remove the unused advansys_setup()
- make needlessly global functions static

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/advansys.c |  101 +++---
 drivers/scsi/advansys.h |   36 -
 2 files changed, 8 insertions(+), 129 deletions(-)

diff -puN drivers/scsi/advansys.c~drivers-scsi-advansysc-cleanups 
drivers/scsi/advansys.c
--- a/drivers/scsi/advansys.c~drivers-scsi-advansysc-cleanups
+++ a/drivers/scsi/advansys.c
@@ -798,7 +798,6 @@
 #include scsi/scsi_tcq.h
 #include scsi/scsi.h
 #include scsi/scsi_host.h
-#include advansys.h
 #ifdef CONFIG_PCI
 #include linux/pci.h
 #endif /* CONFIG_PCI */
@@ -2014,7 +2013,7 @@ STATIC int   AscSgListToQueue(int);
 STATIC void  AscEnableIsaDma(uchar);
 #endif /* CONFIG_ISA */
 STATIC ASC_DCNT  AscGetMaxDmaCount(ushort);
-
+static const char *advansys_info(struct Scsi_Host *shp);
 
 /*
  * --- Adv Library Constants and Macros
@@ -3970,10 +3969,6 @@ STATIC ushort asc_bus[ASC_NUM_BUS] __ini
 ASC_IS_PCI,
 };
 
-/*
- * Used with the LILO 'advansys' option to eliminate or
- * limit I/O port probing at boot time, cf. advansys_setup().
- */
 STATIC int asc_iopflag = ASC_FALSE;
 STATIC int asc_ioport[ASC_NUM_IOPORT_PROBE] = { 0, 0, 0, 0 };
 
@@ -4055,10 +4050,6 @@ STATIC void asc_prt_hex(char *f,
 #endif /* ADVANSYS_DEBUG */
 
 
-/*
- * --- Linux 'struct scsi_host_template' and advansys_setup() Functions
- */
-
 #ifdef CONFIG_PROC_FS
 /*
  * advansys_proc_info() - /proc/scsi/advansys/[0-(ASC_NUM_BOARD_SUPPORTED-1)]
@@ -4080,7 +4071,7 @@ STATIC void asc_prt_hex(char *f,
  * if 'prtbuf' is too small it will not be overwritten. Instead the
  * user just won't get all the available statistics.
  */
-int
+static int
 advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
off_t offset, int length, int inout)
 {
@@ -4296,7 +4287,7 @@ advansys_proc_info(struct Scsi_Host *sho
  * it must not call SCSI mid-level functions including scsi_malloc()
  * and scsi_free().
  */
-int __init
+static int __init
 advansys_detect(struct scsi_host_template *tpnt)
 {
 static int  detect_called = ASC_FALSE;
@@ -5428,7 +5419,7 @@ advansys_detect(struct scsi_host_templat
  *
  * Release resources allocated for a single AdvanSys adapter.
  */
-int
+static int
 advansys_release(struct Scsi_Host *shp)
 {
 asc_board_t*boardp;
@@ -5475,7 +5466,7 @@ advansys_release(struct Scsi_Host *shp)
  * Note: The information line should not exceed ASC_INFO_SIZE bytes,
  * otherwise the static 'info' array will be overrun.
  */
-const char *
+static const char *
 advansys_info(struct Scsi_Host *shp)
 {
 static char info[ASC_INFO_SIZE];
@@ -5568,7 +5559,7 @@ advansys_info(struct Scsi_Host *shp)
  * This function always returns 0. Command return status is saved
  * in the 'scp' result field.
  */
-int
+static int
 advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))
 {
 struct Scsi_Host*shp;
@@ -5656,7 +5647,7 @@ advansys_queuecommand(struct scsi_cmnd *
  * sleeping is allowed and no locking other than for host structures is
  * required. Returns SUCCESS or FAILED.
  */
-int
+static int
 advansys_reset(struct scsi_cmnd *scp)
 {
 struct Scsi_Host *shp;
@@ -5841,7 +5832,7 @@ advansys_reset(struct scsi_cmnd *scp)
  * ip[1]: sectors
  * ip[2]: cylinders
  */
-int
+static int
 advansys_biosparam(struct scsi_device *sdev, struct block_device *bdev,
sector_t capacity, int ip[])
 {
@@ -5875,82 +5866,6 @@ advansys_biosparam(struct scsi_device *s
 }
 
 /*
- * advansys_setup()
- *
- * This function is called from init/main.c at boot time.
- * It it passed LILO parameters that can be set from the
- * LILO command line or in /etc/lilo.conf.
- *
- * It is used by the AdvanSys driver to either disable I/O
- * port scanning or to limit scanning to 1 - 4 I/O ports.
- * Regardless of the option setting EISA and PCI boards
- * will still be searched for and detected. This option
- * only affects searching for ISA and VL boards.
- *
- * If ADVANSYS_DEBUG is defined the driver debug level may
- * be set using the 5th (ASC_NUM_IOPORT_PROBE + 1) I/O Port.
- *
- * Examples:
- * 1. Eliminate I/O port scanning:
- * boot: linux advansys=
- *   or
- * boot: linux advansys=0x0
- * 2. Limit I/O port scanning to one I/O port:
- *boot: linux advansys=0x110
- * 3. Limit I/O port scanning to four I/O ports:
- *boot: linux advansys=0x110,0x210,0x230,0x330
- * 4. If ADVANSYS_DEBUG, limit I/O port scanning to four I/O ports and
- *set the driver debug level to 2.
- *boot: linux advansys=0x110,0x210,0x230,0x330,0xdeb2
- *
- * ints[0] - number of arguments
- * ints[1] - first argument
- * ints[2] - second argument
- * ...
- */
-void __init
-advansys_setup(char *str, int *ints)
-{
-int

Re: [patch 02/25] drivers/scsi/advansys.c: cleanups

2007-05-23 Thread James Bottomley
On Wed, 2007-05-23 at 14:41 -0700, [EMAIL PROTECTED] wrote:
 From: Adrian Bunk [EMAIL PROTECTED]
 
 - remove the unneeded advansys.h
 - remove the unused advansys_setup()

This isn't quite right, though, is it?  advansys_setup() should be used.

It looks like there was a bogus conversion away from init/main.c which
left the function dangling.  Isn't the correct thing to do to wire it up
in advansys_detect() which is where it should have been in the first
place.

James


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 02/25] drivers/scsi/advansys.c: cleanups

2007-05-23 Thread Andrew Morton
On Wed, 23 May 2007 18:21:31 -0500
James Bottomley [EMAIL PROTECTED] wrote:

 On Wed, 2007-05-23 at 14:41 -0700, [EMAIL PROTECTED] wrote:
  From: Adrian Bunk [EMAIL PROTECTED]
  
  - remove the unneeded advansys.h
  - remove the unused advansys_setup()
 
 This isn't quite right, though, is it?  advansys_setup() should be used.
 
 It looks like there was a bogus conversion away from init/main.c which
 left the function dangling.  Isn't the correct thing to do to wire it up
 in advansys_detect() which is where it should have been in the first
 place.
 

Even going back to linux-2.4.2 I can find no caller to advansys_setup(). 
Or was its call buried in the magical template macros?

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html