Hi,

Here's a patch against 2.5.1-pre1 that cleans up the symbol namespace of
the usb-serial drivers, marking global symbols and functions that don't
need to be, static, and removes a few unused symbols in the io_edgeport
driver.  The prompting for this came from Arnd Bergmann on the kernel
janitor mailing list.

thanks,

greg k-h



diff --minimal -Nru a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
--- a/drivers/usb/serial/belkin_sa.c    Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/belkin_sa.c    Mon Nov 26 16:22:59 2001
@@ -140,7 +140,7 @@
 MODULE_DEVICE_TABLE (usb, id_table_combined);
 
 /* All of the device info needed for the Belkin dockstation serial converter */
-struct usb_serial_device_type belkin_dockstation_device = {
+static struct usb_serial_device_type belkin_dockstation_device = {
        name:                   "Belkin F5U120-PC USB Serial Adapter",
        id_table:               belkin_dockstation_table,               /* the Belkin 
F5U103 device */
        needs_interrupt_in:     MUST_HAVE,                      /* this device must 
have an interrupt in endpoint */
@@ -161,7 +161,7 @@
 };
 
 /* All of the device info needed for the Belkin serial converter */
-struct usb_serial_device_type belkin_sa_device = {
+static struct usb_serial_device_type belkin_sa_device = {
        name:                   "Belkin F5U103 USB Serial Adapter",
        id_table:               belkin_sa_table,                /* the Belkin F5U103 
device */
        needs_interrupt_in:     MUST_HAVE,                      /* this device must 
have an interrupt in endpoint */
@@ -183,7 +183,7 @@
 
 
 /* This driver also supports the "old" school Belkin single port adaptor */
-struct usb_serial_device_type belkin_old_device = {
+static struct usb_serial_device_type belkin_old_device = {
        name:                   "Belkin USB Serial Adapter",
        id_table:               belkin_old_table,               /* the old Belkin 
device */
        needs_interrupt_in:     MUST_HAVE,                      /* this device must 
have an interrupt in endpoint */
@@ -204,7 +204,7 @@
 };
 
 /* this driver also works for the Peracom single port adapter */
-struct usb_serial_device_type peracom_device = {
+static struct usb_serial_device_type peracom_device = {
        name:                   "Peracom single port USB Serial Adapter",
        id_table:               peracom_table,                  /* the Peracom device 
*/
        needs_interrupt_in:     MUST_HAVE,                      /* this device must 
have an interrupt in endpoint */
@@ -225,7 +225,7 @@
 };
 
 /* the GoHubs Go-COM232 device is the same as the Peracom single port adapter */
-struct usb_serial_device_type gocom232_device = {
+static struct usb_serial_device_type gocom232_device = {
        name:                   "GO-COM232 USB Serial Converter",
        id_table:               gocom232_table,                 /* the GO-COM232 
device */
        needs_interrupt_in:     MUST_HAVE,                      /* this device must 
have an interrupt in endpoint */
diff --minimal -Nru a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
--- a/drivers/usb/serial/cyberjack.c    Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/cyberjack.c    Mon Nov 26 16:22:59 2001
@@ -76,7 +76,7 @@
 
 MODULE_DEVICE_TABLE (usb, id_table);
 
-struct usb_serial_device_type cyberjack_device = {
+static struct usb_serial_device_type cyberjack_device = {
        name:                   "Reiner SCT Cyberjack USB card reader",
        id_table:               id_table,
        needs_interrupt_in:     MUST_HAVE,
diff --minimal -Nru a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
--- a/drivers/usb/serial/empeg.c        Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/empeg.c        Mon Nov 26 16:22:59 2001
@@ -113,7 +113,7 @@
 
 MODULE_DEVICE_TABLE (usb, id_table);
 
-struct usb_serial_device_type empeg_device = {
+static struct usb_serial_device_type empeg_device = {
        name:                   "Empeg",
        id_table:               id_table,
        needs_interrupt_in:     MUST_HAVE_NOT,  /* must not have an interrupt in 
endpoint */
diff --minimal -Nru a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
--- a/drivers/usb/serial/ftdi_sio.c     Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/ftdi_sio.c     Mon Nov 26 16:22:59 2001
@@ -173,7 +173,7 @@
 /* Should rename most ftdi_sio's to ftdi_ now since there are two devices 
    which share common code */ 
 
-struct usb_serial_device_type ftdi_sio_device = {
+static struct usb_serial_device_type ftdi_sio_device = {
        name:                   "FTDI SIO",
        id_table:               id_table_sio,
        needs_interrupt_in:     MUST_HAVE_NOT,
@@ -196,7 +196,7 @@
         shutdown:               ftdi_sio_shutdown,
 };
 
-struct usb_serial_device_type ftdi_8U232AM_device = {
+static struct usb_serial_device_type ftdi_8U232AM_device = {
        name:                   "FTDI 8U232AM",
        id_table:               id_table_8U232AM,
        needs_interrupt_in:     DONT_CARE,
@@ -660,7 +660,7 @@
 } /* ftdi_sio_serial_read_bulk_callback */
 
 
-__u16 translate_baudrate_to_ftdi(unsigned int cflag, ftdi_type_t ftdi_type) 
+static __u16 translate_baudrate_to_ftdi(unsigned int cflag, ftdi_type_t ftdi_type) 
 { /* translate_baudrate_to_ftdi */
        
        __u16 urb_value = ftdi_sio_b9600;
diff --minimal -Nru a/drivers/usb/serial/io_edgeport.c 
b/drivers/usb/serial/io_edgeport.c
--- a/drivers/usb/serial/io_edgeport.c  Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/io_edgeport.c  Mon Nov 26 16:22:59 2001
@@ -318,11 +318,6 @@
 };
 
 
-/* the info for all of the devices that this driver supports */
-int EdgeportDevices[] = EDGEPORT_DEVICE_IDS;
-#define NUM_EDGEPORT_DEVICES (sizeof(EdgeportDevices) / sizeof(int))
-
-
 /* Transmit Fifo 
  * This Transmit queue is an extension of the edgeport Rx buffer. 
  * The maximum amount of data buffered in both the edgeport 
@@ -495,17 +490,15 @@
 // ************************************************************************
 // ************************************************************************
 
-// These functions should be in firmware.c
-
 /************************************************************************
  *                                                                     *
- *     update_edgeport_E2PROM()        Compare current versions of             *
+ * update_edgeport_E2PROM()    Compare current versions of             *
  *                             Boot ROM and Manufacture                *
  *                             Descriptors with versions               *
  *                             embedded in this driver                 *
  *                                                                     *
  ************************************************************************/
-void update_edgeport_E2PROM (struct edgeport_serial *edge_serial)
+static void update_edgeport_E2PROM (struct edgeport_serial *edge_serial)
 {
        __u32 BootCurVer;
        __u32 BootNewVer;
diff --minimal -Nru a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
--- a/drivers/usb/serial/keyspan.c      Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/keyspan.c      Mon Nov 26 16:22:59 2001
@@ -176,7 +176,7 @@
 
 
 /* Functions used by new usb-serial code. */
-int keyspan_init (void)
+static int __init keyspan_init (void)
 {
        usb_serial_register (&keyspan_usa18x_pre_device);
        usb_serial_register (&keyspan_usa19_pre_device);
@@ -201,7 +201,7 @@
        return 0;
 }
 
-void keyspan_exit (void)
+static void __exit keyspan_exit (void)
 {
        usb_serial_deregister (&keyspan_usa18x_pre_device);
        usb_serial_deregister (&keyspan_usa19_pre_device);
@@ -1089,7 +1089,7 @@
        return urb;
 }
 
-struct callbacks {
+static struct callbacks {
        void    (*instat_callback)(urb_t *);
        void    (*glocont_callback)(urb_t *);
        void    (*indat_callback)(urb_t *);
diff --minimal -Nru a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h
--- a/drivers/usb/serial/keyspan.h      Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/keyspan.h      Mon Nov 26 16:22:59 2001
@@ -448,7 +448,7 @@
 };
 
     /* Structs for the devices, pre and post renumeration. */
-struct usb_serial_device_type keyspan_usa18x_pre_device = {
+static struct usb_serial_device_type keyspan_usa18x_pre_device = {
        name:                   "Keyspan USA18X - (without firmware)",
        id_table:               keyspan_usa18x_pre_ids,
        needs_interrupt_in:     DONT_CARE,
@@ -461,7 +461,7 @@
        startup:                keyspan_fake_startup    
 };
 
-struct usb_serial_device_type keyspan_usa19_pre_device = {
+static struct usb_serial_device_type keyspan_usa19_pre_device = {
        name:                   "Keyspan USA19 - (without firmware)",
        id_table:               keyspan_usa19_pre_ids,
        needs_interrupt_in:     DONT_CARE,
@@ -475,7 +475,7 @@
 };
 
 
-struct usb_serial_device_type keyspan_usa19w_pre_device = {
+static struct usb_serial_device_type keyspan_usa19w_pre_device = {
        name:                   "Keyspan USA19W - (without firmware)",
        id_table:               keyspan_usa19w_pre_ids,
        needs_interrupt_in:     DONT_CARE,
@@ -489,7 +489,7 @@
 };
 
 
-struct usb_serial_device_type keyspan_usa28_pre_device = {
+static struct usb_serial_device_type keyspan_usa28_pre_device = {
        name:                   "Keyspan USA28 - (without firmware)",
        id_table:               keyspan_usa28_pre_ids,
        needs_interrupt_in:     DONT_CARE,
@@ -502,7 +502,7 @@
        startup:                keyspan_fake_startup    
 };
 
-struct usb_serial_device_type keyspan_usa28x_pre_device = {
+static struct usb_serial_device_type keyspan_usa28x_pre_device = {
        name:                   "Keyspan USA28X - (without firmware)",
        id_table:               keyspan_usa28x_pre_ids,
        needs_interrupt_in:     DONT_CARE,
@@ -515,7 +515,7 @@
        startup:                keyspan_fake_startup    
 };
 
-struct usb_serial_device_type keyspan_usa28xa_pre_device = {
+static struct usb_serial_device_type keyspan_usa28xa_pre_device = {
        name:                   "Keyspan USA28XA - (without firmware)",
        id_table:               keyspan_usa28xa_pre_ids,
        needs_interrupt_in:     DONT_CARE,
@@ -528,7 +528,7 @@
        startup:                keyspan_fake_startup    
 };
 
-struct usb_serial_device_type keyspan_usa28xb_pre_device = {
+static struct usb_serial_device_type keyspan_usa28xb_pre_device = {
        name:                   "Keyspan USA28XB - (without firmware)",
        id_table:               keyspan_usa28xb_pre_ids,
        needs_interrupt_in:     DONT_CARE,
@@ -541,7 +541,7 @@
        startup:                keyspan_fake_startup    
 };
 
-struct usb_serial_device_type keyspan_usa49w_pre_device = {
+static struct usb_serial_device_type keyspan_usa49w_pre_device = {
        name:                   "Keyspan USA49W - (without firmware)",
        id_table:               keyspan_usa49w_pre_ids,
        needs_interrupt_in:     DONT_CARE,
@@ -554,7 +554,7 @@
        startup:                keyspan_fake_startup    
 };
 
-struct usb_serial_device_type keyspan_usa18x_device = {
+static struct usb_serial_device_type keyspan_usa18x_device = {
        name:                   "Keyspan USA18X",
        id_table:               keyspan_usa18x_ids,
        needs_interrupt_in:     DONT_CARE,      
@@ -580,7 +580,7 @@
        shutdown:               keyspan_shutdown,
 };
 
-struct usb_serial_device_type keyspan_usa19_device = {
+static struct usb_serial_device_type keyspan_usa19_device = {
        name:                   "Keyspan USA19",
        id_table:               keyspan_usa19_ids,
        needs_interrupt_in:     DONT_CARE,      
@@ -607,7 +607,7 @@
 };
 
 
-struct usb_serial_device_type keyspan_usa19w_device = {
+static struct usb_serial_device_type keyspan_usa19w_device = {
        name:                   "Keyspan USA19W",
        id_table:               keyspan_usa19w_ids,
        needs_interrupt_in:     DONT_CARE,      
@@ -634,7 +634,7 @@
 };
 
 
-struct usb_serial_device_type keyspan_usa28_device = {
+static struct usb_serial_device_type keyspan_usa28_device = {
        name:                   "Keyspan USA28",
        id_table:               keyspan_usa28_ids,
        needs_interrupt_in:     DONT_CARE,      
@@ -652,7 +652,7 @@
 };
 
 
-struct usb_serial_device_type keyspan_usa28x_device = {
+static struct usb_serial_device_type keyspan_usa28x_device = {
        name:                   "Keyspan USA28X/XB",
        id_table:               keyspan_usa28x_ids,
        needs_interrupt_in:     DONT_CARE,      
@@ -679,7 +679,7 @@
 
 };
 
-struct usb_serial_device_type keyspan_usa28xa_device = {
+static struct usb_serial_device_type keyspan_usa28xa_device = {
        name:                   "Keyspan USA28XA",
        id_table:               keyspan_usa28xa_ids,
        needs_interrupt_in:     DONT_CARE,      
@@ -706,7 +706,7 @@
 
 };
 
-struct usb_serial_device_type keyspan_usa49w_device = {
+static struct usb_serial_device_type keyspan_usa49w_device = {
        name:                   "Keyspan USA49W",
        id_table:               keyspan_usa49w_ids,
        needs_interrupt_in:     DONT_CARE,      
diff --minimal -Nru a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
--- a/drivers/usb/serial/mct_u232.c     Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/mct_u232.c     Mon Nov 26 16:22:59 2001
@@ -154,7 +154,7 @@
 MODULE_DEVICE_TABLE (usb, id_table_combined);
 
 
-struct usb_serial_device_type mct_u232_device = {
+static struct usb_serial_device_type mct_u232_device = {
        name:                "Magic Control Technology USB-RS232",
        id_table:            mct_u232_table,
        needs_interrupt_in:  MUST_HAVE,  /* 2 interrupt-in endpoints */
@@ -178,7 +178,7 @@
        shutdown:            mct_u232_shutdown,
 };
 
-struct usb_serial_device_type mct_u232_sitecom_device = {
+static struct usb_serial_device_type mct_u232_sitecom_device = {
        name:                "MCT/Sitecom USB-RS232",
        id_table:            mct_u232_sitecom_table,
        needs_interrupt_in:  MUST_HAVE,  /* 2 interrupt-in endpoints */
@@ -202,7 +202,7 @@
        shutdown:            mct_u232_shutdown,
 };
 
-struct usb_serial_device_type mct_u232_du_h3sp_device = {
+static struct usb_serial_device_type mct_u232_du_h3sp_device = {
         name:                "MCT/D-Link DU-H3SP USB BAY",
         id_table:            mct_u232_du_h3sp_table,
         needs_interrupt_in:  MUST_HAVE,  /* 2 interrupt-in endpoints */
diff --minimal -Nru a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
--- a/drivers/usb/serial/omninet.c      Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/omninet.c      Mon Nov 26 16:22:59 2001
@@ -87,7 +87,7 @@
 MODULE_DEVICE_TABLE (usb, id_table);
 
 
-struct usb_serial_device_type zyxel_omninet_device = {
+static struct usb_serial_device_type zyxel_omninet_device = {
        name:                   "ZyXEL - omni.net lcd plus usb",
        id_table:               id_table,
        needs_interrupt_in:     MUST_HAVE,
diff --minimal -Nru a/drivers/usb/serial/usbserial.c b/drivers/usb/serial/usbserial.c
--- a/drivers/usb/serial/usbserial.c    Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/usbserial.c    Mon Nov 26 16:22:59 2001
@@ -397,7 +397,7 @@
 static struct usb_serial       *serial_table[SERIAL_TTY_MINORS];       /* initially 
all NULL */
 
 
-LIST_HEAD(usb_serial_driver_list);
+static LIST_HEAD(usb_serial_driver_list);
 
 
 static struct usb_serial *get_serial_by_minor (int minor)
@@ -1433,7 +1433,7 @@
 };
 
 
-int usb_serial_init(void)
+static int __init usb_serial_init(void)
 {
        int i;
        int result;
@@ -1473,7 +1473,7 @@
 }
 
 
-void usb_serial_exit(void)
+static void __exit usb_serial_exit(void)
 {
 
 #ifdef CONFIG_USB_SERIAL_GENERIC
diff --minimal -Nru a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
--- a/drivers/usb/serial/visor.c        Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/visor.c        Mon Nov 26 16:22:59 2001
@@ -184,7 +184,7 @@
 
 
 /* All of the device info needed for the Handspring Visor */
-struct usb_serial_device_type handspring_device = {
+static struct usb_serial_device_type handspring_device = {
        name:                   "Handspring Visor",
        id_table:               visor_id_table,
        needs_interrupt_in:     MUST_HAVE_NOT,          /* this device must not have 
an interrupt in endpoint */
@@ -210,7 +210,7 @@
 };
 
 /* device info for the Palm 4.0 devices */
-struct usb_serial_device_type palm_4_0_device = {
+static struct usb_serial_device_type palm_4_0_device = {
        name:                   "Palm 4.0",
        id_table:               palm_4_0_id_table,
        needs_interrupt_in:     MUST_HAVE_NOT,          /* this device must not have 
an interrupt in endpoint */
diff --minimal -Nru a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
--- a/drivers/usb/serial/whiteheat.c    Mon Nov 26 16:22:59 2001
+++ b/drivers/usb/serial/whiteheat.c    Mon Nov 26 16:22:59 2001
@@ -131,7 +131,7 @@
 static int  whiteheat_startup          (struct usb_serial *serial);
 static void whiteheat_shutdown         (struct usb_serial *serial);
 
-struct usb_serial_device_type whiteheat_fake_device = {
+static struct usb_serial_device_type whiteheat_fake_device = {
        name:                   "Connect Tech - WhiteHEAT - (prerenumeration)",
        id_table:               id_table_prerenumeration,
        needs_interrupt_in:     DONT_CARE,                              /* don't have 
to have an interrupt in endpoint */
@@ -144,7 +144,7 @@
        startup:                whiteheat_startup       
 };
 
-struct usb_serial_device_type whiteheat_device = {
+static struct usb_serial_device_type whiteheat_device = {
        name:                   "Connect Tech - WhiteHEAT",
        id_table:               id_table_std,
        needs_interrupt_in:     DONT_CARE,                              /* don't have 
to have an interrupt in endpoint */


_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to