public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] SCSI: cleanups
  2005-02-28 23:34     ` Christoph Hellwig
@ 2005-03-01  0:31       ` Adrian Bunk
  0 siblings, 0 replies; 7+ messages in thread
From: Adrian Bunk @ 2005-03-01  0:31 UTC (permalink / raw)
  To: Christoph Hellwig, James.Bottomley, linux-scsi, linux-kernel,
	Mark_Salyzyn

Updated patch:

<--  snip  -->

This patch contains the following cleanups:
- make needlessly global code static
- remove the following unused functions:
  - scsi.h: print_driverbyte
  - scsi.h: print_hostbyte
- #if 0 the following unused functions:
  - constants.c: scsi_print_hostbyte
  - constants.c: scsi_print_driverbyte
- remove the following unneeded EXPORT_SYMBOL's:
  - hosts.c: scsi_host_lookup
  - scsi.c: scsi_device_cancel
  - scsi_lib.c: scsi_device_resume

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/scsi/constants.c   |    4 ++++
 drivers/scsi/hosts.c       |    3 +--
 drivers/scsi/scsi.c        |    9 +++++----
 drivers/scsi/scsi.h        |    8 --------
 drivers/scsi/scsi_debug.c  |    2 +-
 drivers/scsi/scsi_lib.c    |    5 ++---
 drivers/scsi/scsi_priv.h   |    4 ----
 drivers/scsi/scsi_sysfs.c  |    4 ++--
 include/scsi/scsi_dbg.h    |    2 --
 include/scsi/scsi_device.h |    1 -
 10 files changed, 15 insertions(+), 27 deletions(-)

--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi.h.old	2005-02-28 18:18:22.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi.h	2005-03-01 00:58:19.000000000 +0100
@@ -80,14 +80,6 @@
 {
 	return scsi_print_req_sense(devclass, req);
 }
-static inline void print_driverbyte(int scsiresult)
-{
-	return scsi_print_driverbyte(scsiresult);
-}
-static inline void print_hostbyte(int scsiresult)
-{
-	return scsi_print_hostbyte(scsiresult);
-}
 static inline void print_status(unsigned char status)
 {
 	return scsi_print_status(status);
--- linux-2.6.11-rc4-mm1-full/include/scsi/scsi_dbg.h.old	2005-02-28 18:17:32.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/include/scsi/scsi_dbg.h	2005-03-01 01:01:25.000000000 +0100
@@ -11,8 +11,6 @@
 extern void __scsi_print_sense(const char *name,
 			       const unsigned char *sense_buffer,
 			       int sense_len);
-extern void scsi_print_driverbyte(int);
-extern void scsi_print_hostbyte(int);
 extern void scsi_print_status(unsigned char);
 extern int scsi_print_msg(const unsigned char *);
 extern const char *scsi_sense_key_string(unsigned char);
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/constants.c.old	2005-02-28 18:17:46.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/constants.c	2005-03-01 01:00:37.000000000 +0100
@@ -1393,6 +1393,8 @@
 }
 EXPORT_SYMBOL(scsi_print_command);
 
+#if 0
+
 #ifdef CONFIG_SCSI_CONSTANTS
 
 static const char * hostbyte_table[]={
@@ -1446,3 +1448,5 @@
 	printk("Driverbyte=0x%02x ", driver_byte(scsiresult));
 }
 #endif
+
+#endif  /*  0  */
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/hosts.c.old	2005-02-28 18:33:14.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/hosts.c	2005-03-01 00:58:19.000000000 +0100
@@ -56,7 +56,7 @@
  * @shost:	pointer to struct Scsi_Host
  * recovery:	recovery requested to run.
  **/
-void scsi_host_cancel(struct Scsi_Host *shost, int recovery)
+static void scsi_host_cancel(struct Scsi_Host *shost, int recovery)
 {
 	struct scsi_device *sdev;
 
@@ -362,7 +362,6 @@
 
 	return shost;
 }
-EXPORT_SYMBOL(scsi_host_lookup);
 
 /**
  * scsi_host_get - inc a Scsi_Host ref count
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_priv.h.old	2005-02-28 19:59:30.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_priv.h	2005-03-01 00:58:19.000000000 +0100
@@ -66,8 +66,6 @@
 extern int scsi_dispatch_cmd(struct scsi_cmnd *cmd);
 extern int scsi_setup_command_freelist(struct Scsi_Host *shost);
 extern void scsi_destroy_command_freelist(struct Scsi_Host *shost);
-extern void scsi_done(struct scsi_cmnd *cmd);
-extern int scsi_retry_command(struct scsi_cmnd *cmd);
 extern int scsi_insert_special_req(struct scsi_request *sreq, int);
 extern void scsi_init_cmd_from_req(struct scsi_cmnd *cmd,
 		struct scsi_request *sreq);
@@ -141,7 +139,6 @@
 #endif /* CONFIG_SYSCTL */
 
 /* scsi_sysfs.c */
-extern void scsi_device_dev_release(struct device *);
 extern int scsi_sysfs_add_sdev(struct scsi_device *);
 extern int scsi_sysfs_add_host(struct Scsi_Host *);
 extern int scsi_sysfs_register(void);
@@ -150,7 +147,6 @@
 extern int scsi_sysfs_target_initialize(struct scsi_device *);
 extern struct scsi_transport_template blank_transport_template;
 
-extern struct class sdev_class;
 extern struct bus_type scsi_bus_type;
 
 /* 
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi.c.old	2005-02-28 19:59:56.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi.c	2005-03-01 00:58:19.000000000 +0100
@@ -68,6 +68,8 @@
 #include "scsi_priv.h"
 #include "scsi_logging.h"
 
+static void scsi_done(struct scsi_cmnd *cmd);
+static int scsi_retry_command(struct scsi_cmnd *cmd);
 
 /*
  * Definitions and constants.
@@ -90,7 +92,7 @@
 /*
  * Data declarations.
  */
-unsigned long scsi_pid;
+static unsigned long scsi_pid;
 static unsigned long serial_number;
 
 /*
@@ -733,7 +735,7 @@
  *
  * This function is interrupt context safe.
  */
-void scsi_done(struct scsi_cmnd *cmd)
+static void scsi_done(struct scsi_cmnd *cmd)
 {
 	/*
 	 * We don't have to worry about this one timing out any more.
@@ -829,7 +831,7 @@
  *              level drivers should not become re-entrant as a result of
  *              this.
  */
-int scsi_retry_command(struct scsi_cmnd *cmd)
+static int scsi_retry_command(struct scsi_cmnd *cmd)
 {
 	/*
 	 * Restore the SCSI command state.
@@ -1215,7 +1217,6 @@
 
 	return 0;
 }
-EXPORT_SYMBOL(scsi_device_cancel);
 
 #ifdef CONFIG_HOTPLUG_CPU
 static int scsi_cpu_notify(struct notifier_block *self,
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_debug.c.old	2005-02-28 20:22:08.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_debug.c	2005-03-01 00:58:19.000000000 +0100
@@ -1783,7 +1783,7 @@
 device_initcall(scsi_debug_init);
 module_exit(scsi_debug_exit);
 
-void pseudo_0_release(struct device * dev)
+static void pseudo_0_release(struct device * dev)
 {
 	if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
 		printk(KERN_INFO "scsi_debug: pseudo_0_release() called\n");
--- linux-2.6.11-rc4-mm1-full/include/scsi/scsi_device.h.old	2005-02-28 20:14:08.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/include/scsi/scsi_device.h	2005-03-01 00:58:19.000000000 +0100
@@ -223,7 +223,6 @@
 extern int scsi_device_set_state(struct scsi_device *sdev,
 				 enum scsi_device_state state);
 extern int scsi_device_quiesce(struct scsi_device *sdev);
-extern void scsi_device_resume(struct scsi_device *sdev);
 extern void scsi_target_quiesce(struct scsi_target *);
 extern void scsi_target_resume(struct scsi_target *);
 extern const char *scsi_device_state_name(enum scsi_device_state);
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_lib.c.old	2005-02-28 20:14:23.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_lib.c	2005-03-01 00:58:19.000000000 +0100
@@ -44,7 +44,7 @@
 #endif
 
 #define SP(x) { x, "sgpool-" #x } 
-struct scsi_host_sg_pool scsi_sg_pools[] = { 
+static struct scsi_host_sg_pool scsi_sg_pools[] = { 
 	SP(8),
 	SP(16),
 	SP(32),
@@ -1817,14 +1817,13 @@
  *
  *	Must be called with user context, may sleep.
  **/
-void
+static void
 scsi_device_resume(struct scsi_device *sdev)
 {
 	if(scsi_device_set_state(sdev, SDEV_RUNNING))
 		return;
 	scsi_run_queue(sdev->request_queue);
 }
-EXPORT_SYMBOL(scsi_device_resume);
 
 static void
 device_quiesce_fn(struct scsi_device *sdev, void *data)
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_sysfs.c.old	2005-02-28 20:19:41.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_sysfs.c	2005-03-01 00:58:19.000000000 +0100
@@ -150,7 +150,7 @@
 	put_device(&sdev->sdev_gendev);
 }
 
-void scsi_device_dev_release(struct device *dev)
+static void scsi_device_dev_release(struct device *dev)
 {
 	struct scsi_device *sdev;
 	struct device *parent;
@@ -188,7 +188,7 @@
 		put_device(parent);
 }
 
-struct class sdev_class = {
+static struct class sdev_class = {
 	.name		= "scsi_device",
 	.release	= scsi_device_cls_release,
 };


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

* [2.6 patch] SCSI: cleanups
@ 2005-03-27 20:21 Adrian Bunk
  2005-03-28 15:21 ` James Bottomley
  0 siblings, 1 reply; 7+ messages in thread
From: Adrian Bunk @ 2005-03-27 20:21 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, linux-kernel

This patch contains the following cleanups:
- make needlessly global code static
- remove the following unused functions:
  - scsi.h: print_driverbyte
  - scsi.h: print_hostbyte
- #if 0 the following unused functions:
  - constants.c: scsi_print_hostbyte
  - constants.c: scsi_print_driverbyte
- remove the following unneeded EXPORT_SYMBOL's:
  - hosts.c: scsi_host_lookup
  - scsi.c: scsi_device_cancel
  - scsi_lib.c: scsi_device_resume

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/scsi/constants.c   |    4 ++++
 drivers/scsi/hosts.c       |    3 +--
 drivers/scsi/scsi.c        |    7 ++++---
 drivers/scsi/scsi.h        |    8 --------
 drivers/scsi/scsi_debug.c  |    2 +-
 drivers/scsi/scsi_lib.c    |    5 ++---
 drivers/scsi/scsi_priv.h   |    4 ----
 drivers/scsi/scsi_sysfs.c  |    5 ++---
 include/scsi/scsi_dbg.h    |    2 --
 include/scsi/scsi_device.h |    1 -
 10 files changed, 14 insertions(+), 27 deletions(-)

--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi.h.old	2005-02-28 18:18:22.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi.h	2005-03-01 00:58:19.000000000 +0100
@@ -80,14 +80,6 @@
 {
 	return scsi_print_req_sense(devclass, req);
 }
-static inline void print_driverbyte(int scsiresult)
-{
-	return scsi_print_driverbyte(scsiresult);
-}
-static inline void print_hostbyte(int scsiresult)
-{
-	return scsi_print_hostbyte(scsiresult);
-}
 static inline void print_status(unsigned char status)
 {
 	return scsi_print_status(status);
--- linux-2.6.11-rc4-mm1-full/include/scsi/scsi_dbg.h.old	2005-02-28 18:17:32.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/include/scsi/scsi_dbg.h	2005-03-01 01:01:25.000000000 +0100
@@ -11,8 +11,6 @@
 extern void __scsi_print_sense(const char *name,
 			       const unsigned char *sense_buffer,
 			       int sense_len);
-extern void scsi_print_driverbyte(int);
-extern void scsi_print_hostbyte(int);
 extern void scsi_print_status(unsigned char);
 extern int scsi_print_msg(const unsigned char *);
 extern const char *scsi_sense_key_string(unsigned char);
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/constants.c.old	2005-02-28 18:17:46.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/constants.c	2005-03-01 01:00:37.000000000 +0100
@@ -1393,6 +1393,8 @@
 }
 EXPORT_SYMBOL(scsi_print_command);
 
+#if 0
+
 #ifdef CONFIG_SCSI_CONSTANTS
 
 static const char * hostbyte_table[]={
@@ -1446,3 +1448,5 @@
 	printk("Driverbyte=0x%02x ", driver_byte(scsiresult));
 }
 #endif
+
+#endif  /*  0  */
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/hosts.c.old	2005-02-28 18:33:14.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/hosts.c	2005-03-01 00:58:19.000000000 +0100
@@ -56,7 +56,7 @@
  * @shost:	pointer to struct Scsi_Host
  * recovery:	recovery requested to run.
  **/
-void scsi_host_cancel(struct Scsi_Host *shost, int recovery)
+static void scsi_host_cancel(struct Scsi_Host *shost, int recovery)
 {
 	struct scsi_device *sdev;
 
@@ -362,7 +362,6 @@
 
 	return shost;
 }
-EXPORT_SYMBOL(scsi_host_lookup);
 
 /**
  * scsi_host_get - inc a Scsi_Host ref count
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_priv.h.old	2005-02-28 19:59:30.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_priv.h	2005-03-01 00:58:19.000000000 +0100
@@ -66,8 +66,6 @@
 extern int scsi_dispatch_cmd(struct scsi_cmnd *cmd);
 extern int scsi_setup_command_freelist(struct Scsi_Host *shost);
 extern void scsi_destroy_command_freelist(struct Scsi_Host *shost);
-extern void scsi_done(struct scsi_cmnd *cmd);
-extern int scsi_retry_command(struct scsi_cmnd *cmd);
 extern int scsi_insert_special_req(struct scsi_request *sreq, int);
 extern void scsi_init_cmd_from_req(struct scsi_cmnd *cmd,
 		struct scsi_request *sreq);
@@ -141,7 +139,6 @@
 #endif /* CONFIG_SYSCTL */
 
 /* scsi_sysfs.c */
-extern void scsi_device_dev_release(struct device *);
 extern int scsi_sysfs_add_sdev(struct scsi_device *);
 extern int scsi_sysfs_add_host(struct Scsi_Host *);
 extern int scsi_sysfs_register(void);
@@ -150,7 +147,6 @@
 extern int scsi_sysfs_target_initialize(struct scsi_device *);
 extern struct scsi_transport_template blank_transport_template;
 
-extern struct class sdev_class;
 extern struct bus_type scsi_bus_type;
 
 /* 
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi.c.old	2005-02-28 19:59:56.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi.c	2005-03-01 00:58:19.000000000 +0100
@@ -68,6 +68,8 @@
 #include "scsi_priv.h"
 #include "scsi_logging.h"
 
+static void scsi_done(struct scsi_cmnd *cmd);
+static int scsi_retry_command(struct scsi_cmnd *cmd);
 
 /*
  * Definitions and constants.
@@ -733,7 +735,7 @@
  *
  * This function is interrupt context safe.
  */
-void scsi_done(struct scsi_cmnd *cmd)
+static void scsi_done(struct scsi_cmnd *cmd)
 {
 	/*
 	 * We don't have to worry about this one timing out any more.
@@ -829,7 +831,7 @@
  *              level drivers should not become re-entrant as a result of
  *              this.
  */
-int scsi_retry_command(struct scsi_cmnd *cmd)
+static int scsi_retry_command(struct scsi_cmnd *cmd)
 {
 	/*
 	 * Restore the SCSI command state.
@@ -1215,7 +1217,6 @@
 
 	return 0;
 }
-EXPORT_SYMBOL(scsi_device_cancel);
 
 #ifdef CONFIG_HOTPLUG_CPU
 static int scsi_cpu_notify(struct notifier_block *self,
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_debug.c.old	2005-02-28 20:22:08.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_debug.c	2005-03-01 00:58:19.000000000 +0100
@@ -1783,7 +1783,7 @@
 device_initcall(scsi_debug_init);
 module_exit(scsi_debug_exit);
 
-void pseudo_0_release(struct device * dev)
+static void pseudo_0_release(struct device * dev)
 {
 	if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
 		printk(KERN_INFO "scsi_debug: pseudo_0_release() called\n");
--- linux-2.6.11-rc4-mm1-full/include/scsi/scsi_device.h.old	2005-02-28 20:14:08.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/include/scsi/scsi_device.h	2005-03-01 00:58:19.000000000 +0100
@@ -223,7 +223,6 @@
 extern int scsi_device_set_state(struct scsi_device *sdev,
 				 enum scsi_device_state state);
 extern int scsi_device_quiesce(struct scsi_device *sdev);
-extern void scsi_device_resume(struct scsi_device *sdev);
 extern void scsi_target_quiesce(struct scsi_target *);
 extern void scsi_target_resume(struct scsi_target *);
 extern const char *scsi_device_state_name(enum scsi_device_state);
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_lib.c.old	2005-02-28 20:14:23.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_lib.c	2005-03-01 00:58:19.000000000 +0100
@@ -44,7 +44,7 @@
 #endif
 
 #define SP(x) { x, "sgpool-" #x } 
-struct scsi_host_sg_pool scsi_sg_pools[] = { 
+static struct scsi_host_sg_pool scsi_sg_pools[] = { 
 	SP(8),
 	SP(16),
 	SP(32),
@@ -1817,14 +1817,13 @@
  *
  *	Must be called with user context, may sleep.
  **/
-void
+static void
 scsi_device_resume(struct scsi_device *sdev)
 {
 	if(scsi_device_set_state(sdev, SDEV_RUNNING))
 		return;
 	scsi_run_queue(sdev->request_queue);
 }
-EXPORT_SYMBOL(scsi_device_resume);
 
 static void
 device_quiesce_fn(struct scsi_device *sdev, void *data)
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_sysfs.c.old	2005-02-28 20:19:41.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_sysfs.c	2005-03-01 00:58:19.000000000 +0100
@@ -150,7 +150,7 @@
 	put_device(&sdev->sdev_gendev);
 }
 
-void scsi_device_dev_release(struct device *dev)
+static void scsi_device_dev_release(struct device *dev)
 {
 	struct scsi_device *sdev;
 	struct device *parent;
@@ -188,7 +188,7 @@
 		put_device(parent);
 }
 
-struct class sdev_class = {
+static struct class sdev_class = {
 	.name		= "scsi_device",
 	.release	= scsi_device_cls_release,
 };


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

* Re: [2.6 patch] SCSI: cleanups
  2005-03-27 20:21 [2.6 patch] SCSI: cleanups Adrian Bunk
@ 2005-03-28 15:21 ` James Bottomley
  2005-03-28 15:29   ` Arjan van de Ven
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: James Bottomley @ 2005-03-28 15:21 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: SCSI Mailing List, Linux Kernel

On Sun, 2005-03-27 at 22:21 +0200, Adrian Bunk wrote:
> This patch contains the following cleanups:
[..]

No to all of this:

> - remove the following unused functions:
>   - scsi.h: print_driverbyte
>   - scsi.h: print_hostbyte
> - #if 0 the following unused functions:
>   - constants.c: scsi_print_hostbyte
>   - constants.c: scsi_print_driverbyte

These are useful to those of us who debug drivers.

> - remove the following unneeded EXPORT_SYMBOL's:
>   - hosts.c: scsi_host_lookup
>   - scsi.c: scsi_device_cancel
>   - scsi_lib.c: scsi_device_resume

These are part of the SCSI API.

James



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

* Re: [2.6 patch] SCSI: cleanups
  2005-03-28 15:21 ` James Bottomley
@ 2005-03-28 15:29   ` Arjan van de Ven
  2005-03-28 16:00     ` James Bottomley
  2005-03-31 21:07   ` Adrian Bunk
  2005-04-23 22:14   ` [2.6 patch] SCSI: make code static Adrian Bunk
  2 siblings, 1 reply; 7+ messages in thread
From: Arjan van de Ven @ 2005-03-28 15:29 UTC (permalink / raw)
  To: James Bottomley; +Cc: Adrian Bunk, SCSI Mailing List, Linux Kernel

On Mon, 2005-03-28 at 09:21 -0600, James Bottomley wrote:
\
> > - remove the following unused functions:
> >   - scsi.h: print_driverbyte
> >   - scsi.h: print_hostbyte
> > - #if 0 the following unused functions:
> >   - constants.c: scsi_print_hostbyte
> >   - constants.c: scsi_print_driverbyte
> 
> These are useful to those of us who debug drivers.

how about a CONFIG_SCSI_DRIVER_DEBUG ?




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

* Re: [2.6 patch] SCSI: cleanups
  2005-03-28 15:29   ` Arjan van de Ven
@ 2005-03-28 16:00     ` James Bottomley
  0 siblings, 0 replies; 7+ messages in thread
From: James Bottomley @ 2005-03-28 16:00 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Adrian Bunk, SCSI Mailing List, Linux Kernel

On Mon, 2005-03-28 at 17:29 +0200, Arjan van de Ven wrote:
> how about a CONFIG_SCSI_DRIVER_DEBUG ?

In principle, that's fine ... in practice does the few bytes saved by
this really justify adding yet another option?

James



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

* Re: [2.6 patch] SCSI: cleanups
  2005-03-28 15:21 ` James Bottomley
  2005-03-28 15:29   ` Arjan van de Ven
@ 2005-03-31 21:07   ` Adrian Bunk
  2005-04-23 22:14   ` [2.6 patch] SCSI: make code static Adrian Bunk
  2 siblings, 0 replies; 7+ messages in thread
From: Adrian Bunk @ 2005-03-31 21:07 UTC (permalink / raw)
  To: James Bottomley; +Cc: SCSI Mailing List, Linux Kernel

On Mon, Mar 28, 2005 at 09:21:45AM -0600, James Bottomley wrote:
> On Sun, 2005-03-27 at 22:21 +0200, Adrian Bunk wrote:
> > This patch contains the following cleanups:
> [..]
> 
> No to all of this:
> 
> > - remove the following unused functions:
> >   - scsi.h: print_driverbyte
> >   - scsi.h: print_hostbyte
> > - #if 0 the following unused functions:
> >   - constants.c: scsi_print_hostbyte
> >   - constants.c: scsi_print_driverbyte
> 
> These are useful to those of us who debug drivers.
>...

Does this really include the legacy print_driverbyte and print_hostbyte 
wrappers?

> James

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* [2.6 patch] SCSI: make code static
  2005-03-28 15:21 ` James Bottomley
  2005-03-28 15:29   ` Arjan van de Ven
  2005-03-31 21:07   ` Adrian Bunk
@ 2005-04-23 22:14   ` Adrian Bunk
  2 siblings, 0 replies; 7+ messages in thread
From: Adrian Bunk @ 2005-04-23 22:14 UTC (permalink / raw)
  To: James Bottomley; +Cc: SCSI Mailing List, Linux Kernel

On Mon, Mar 28, 2005 at 09:21:45AM -0600, James Bottomley wrote:
> On Sun, 2005-03-27 at 22:21 +0200, Adrian Bunk wrote:
> > This patch contains the following cleanups:
> [..]
> 
> No to all of this:
> 
> > - remove the following unused functions:
> >   - scsi.h: print_driverbyte
> >   - scsi.h: print_hostbyte
> > - #if 0 the following unused functions:
> >   - constants.c: scsi_print_hostbyte
> >   - constants.c: scsi_print_driverbyte
> 
> These are useful to those of us who debug drivers.
> 
> > - remove the following unneeded EXPORT_SYMBOL's:
> >   - hosts.c: scsi_host_lookup
> >   - scsi.c: scsi_device_cancel
> >   - scsi_lib.c: scsi_device_resume
> 
> These are part of the SCSI API.

Below is a patch with only the parts you didn't veto.

> James

cu
Adrian


<--  snip  -->


This patch makes some needlessly global code static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/scsi/hosts.c      |    2 +-
 drivers/scsi/scsi.c       |    6 ++++--
 drivers/scsi/scsi_debug.c |    2 +-
 drivers/scsi/scsi_lib.c   |    2 +-
 drivers/scsi/scsi_priv.h  |    4 ----
 drivers/scsi/scsi_sysfs.c |    4 ++--
 6 files changed, 9 insertions(+), 11 deletions(-)

--- linux-2.6.11-rc4-mm1-full/drivers/scsi/hosts.c.old	2005-02-28 18:33:14.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/hosts.c	2005-03-01 00:58:19.000000000 +0100
@@ -56,7 +56,7 @@
  * @shost:	pointer to struct Scsi_Host
  * recovery:	recovery requested to run.
  **/
-void scsi_host_cancel(struct Scsi_Host *shost, int recovery)
+static void scsi_host_cancel(struct Scsi_Host *shost, int recovery)
 {
 	struct scsi_device *sdev;
 
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_priv.h.old	2005-02-28 19:59:30.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_priv.h	2005-03-01 00:58:19.000000000 +0100
@@ -66,8 +66,6 @@
 extern int scsi_dispatch_cmd(struct scsi_cmnd *cmd);
 extern int scsi_setup_command_freelist(struct Scsi_Host *shost);
 extern void scsi_destroy_command_freelist(struct Scsi_Host *shost);
-extern void scsi_done(struct scsi_cmnd *cmd);
-extern int scsi_retry_command(struct scsi_cmnd *cmd);
 extern int scsi_insert_special_req(struct scsi_request *sreq, int);
 extern void scsi_init_cmd_from_req(struct scsi_cmnd *cmd,
 		struct scsi_request *sreq);
@@ -141,7 +139,6 @@
 #endif /* CONFIG_SYSCTL */
 
 /* scsi_sysfs.c */
-extern void scsi_device_dev_release(struct device *);
 extern int scsi_sysfs_add_sdev(struct scsi_device *);
 extern int scsi_sysfs_add_host(struct Scsi_Host *);
 extern int scsi_sysfs_register(void);
@@ -150,7 +147,6 @@
 extern int scsi_sysfs_target_initialize(struct scsi_device *);
 extern struct scsi_transport_template blank_transport_template;
 
-extern struct class sdev_class;
 extern struct bus_type scsi_bus_type;
 
 /* 
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi.c.old	2005-02-28 19:59:56.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi.c	2005-03-01 00:58:19.000000000 +0100
@@ -68,6 +68,8 @@
 #include "scsi_priv.h"
 #include "scsi_logging.h"
 
+static void scsi_done(struct scsi_cmnd *cmd);
+static int scsi_retry_command(struct scsi_cmnd *cmd);
 
 /*
  * Definitions and constants.
@@ -733,7 +735,7 @@
  *
  * This function is interrupt context safe.
  */
-void scsi_done(struct scsi_cmnd *cmd)
+static void scsi_done(struct scsi_cmnd *cmd)
 {
 	/*
 	 * We don't have to worry about this one timing out any more.
@@ -829,7 +831,7 @@
  *              level drivers should not become re-entrant as a result of
  *              this.
  */
-int scsi_retry_command(struct scsi_cmnd *cmd)
+static int scsi_retry_command(struct scsi_cmnd *cmd)
 {
 	/*
 	 * Restore the SCSI command state.
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_debug.c.old	2005-02-28 20:22:08.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_debug.c	2005-03-01 00:58:19.000000000 +0100
@@ -1783,7 +1783,7 @@
 device_initcall(scsi_debug_init);
 module_exit(scsi_debug_exit);
 
-void pseudo_0_release(struct device * dev)
+static void pseudo_0_release(struct device * dev)
 {
 	if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
 		printk(KERN_INFO "scsi_debug: pseudo_0_release() called\n");
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_lib.c.old	2005-02-28 20:14:23.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_lib.c	2005-03-01 00:58:19.000000000 +0100
@@ -44,7 +44,7 @@
 #endif
 
 #define SP(x) { x, "sgpool-" #x } 
-struct scsi_host_sg_pool scsi_sg_pools[] = { 
+static struct scsi_host_sg_pool scsi_sg_pools[] = { 
 	SP(8),
 	SP(16),
 	SP(32),
--- linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_sysfs.c.old	2005-02-28 20:19:41.000000000 +0100
+++ linux-2.6.11-rc4-mm1-full/drivers/scsi/scsi_sysfs.c	2005-03-01 00:58:19.000000000 +0100
@@ -150,7 +150,7 @@
 	put_device(&sdev->sdev_gendev);
 }
 
-void scsi_device_dev_release(struct device *dev)
+static void scsi_device_dev_release(struct device *dev)
 {
 	struct scsi_device *sdev;
 	struct device *parent;
@@ -188,7 +188,7 @@
 		put_device(parent);
 }
 
-struct class sdev_class = {
+static struct class sdev_class = {
 	.name		= "scsi_device",
 	.release	= scsi_device_cls_release,
 };


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

end of thread, other threads:[~2005-04-23 22:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-27 20:21 [2.6 patch] SCSI: cleanups Adrian Bunk
2005-03-28 15:21 ` James Bottomley
2005-03-28 15:29   ` Arjan van de Ven
2005-03-28 16:00     ` James Bottomley
2005-03-31 21:07   ` Adrian Bunk
2005-04-23 22:14   ` [2.6 patch] SCSI: make code static Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2005-02-28 21:31 [2.6 patch] SCSI: possible cleanups Adrian Bunk
2005-02-28 22:25 ` Christoph Hellwig
2005-02-28 23:01   ` Adrian Bunk
2005-02-28 23:34     ` Christoph Hellwig
2005-03-01  0:31       ` [2.6 patch] SCSI: cleanups Adrian Bunk

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