Hi!

Here are few minor cleanups to usb-storage. Please apply.

[There's no need to use __u8 in kernel: u8 is fine and looks less
ugly. __u8 is needed for userspace where namespace polution is an
issue.]

                                                                Pavel

--- clean/drivers/usb/usb-storage.c     Thu Apr 27 10:05:49 2000
+++ linux/drivers/usb/usb-storage.c     Thu Apr 27 10:42:39 2000
@@ -52,14 +52,12 @@
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
+static int my_host_number = 0;
+
 /*
  * Per device data
  */
 
-static int my_host_number;
-
-struct us_data;
-
 typedef int (*trans_cmnd)(Scsi_Cmnd*, struct us_data*);
 typedef int (*trans_reset)(struct us_data*);
 typedef void (*proto_cmnd)(Scsi_Cmnd*, struct us_data*);
@@ -80,15 +78,15 @@
        char                    serial[32];
        char                    *transport_name;
        char                    *protocol_name;
-       __u8                    subclass;
-       __u8                    protocol;
+       u8                      subclass;
+       u8                      protocol;
 
        /* information about the device -- only good if device is attached */
-       __u8                    ifnum;           /* interface number   */
-       __u8                    ep_in;           /* bulk in endpoint   */
-       __u8                    ep_out;          /* bulk out endpoint  */
-       __u8                    ep_int;          /* interrupt endpoint */
-       __u8                    ep_interval;     /* interrupt interval */
+       u8                      ifnum;           /* interface number   */
+       u8                      ep_in;           /* bulk in endpoint   */
+       u8                      ep_out;          /* bulk out endpoint  */
+       u8                      ep_int;          /* interrupt endpoint */
+       u8                    ep_interval;     /* interrupt interval */
 
        /* function pointers for this device */
        trans_cmnd              transport;       /* transport function     */
@@ -110,7 +108,7 @@
 
        /* interrupt info for CBI devices -- only good if attached */
        struct semaphore        ip_waitq;        /* for CBI interrupts   */
-       __u16                   ip_data;         /* interrupt data       */
+       u16                     ip_data;         /* interrupt data       */
        int                     ip_wanted;       /* is an IRQ expected?  */
        void                    *irq_handle;     /* for USB int requests */
        unsigned int            irqpipe;         /* pipe for release_irq */
@@ -444,7 +442,7 @@
        /* is the device removed? */
        if (state != -ENOENT) {
                /* save the data for interpretation later */
-               us->ip_data = le16_to_cpup((__u16 *)buffer);
+               us->ip_data = le16_to_cpup((u16 *)buffer);
                US_DEBUGP("-- Interrupt Status 0x%x\n", us->ip_data);
   
                /* was this a wanted interrupt? */
@@ -1284,23 +1282,12 @@
        emulated:               TRUE
 };
 
-static unsigned char sense_notready[] = {
-       0x70,                       /* current error */
-       0x00,
-       0x02,                       /* not ready */
-       0x00,
-       0x00,
-       0x0a,                       /* additional length */
-       0x00,
-       0x00,
-       0x00,
-       0x00,
-       0x04,                       /* not ready */
-       0x03,                       /* manual intervention */
-       0x00,
-       0x00,
-       0x00,
-       0x00
+static unsigned char sense_notready[16] = {
+       [0]  = 0x70,                        /* current error */
+       [2]  = 0x02,                        /* not ready */
+       [5]  = 0x0a,                        /* additional length */
+       [10] = 0x04,                        /* not ready */
+       [11] = 0x03,                        /* manual intervention */
 };
 
 static int usb_stor_control_thread(void * __us)
@@ -1446,8 +1433,8 @@
  * defining how we should support this device, or NULL if it's not in the
  * list
  */
-static struct us_unusual_dev* us_find_dev(__u16 idVendor, __u16 idProduct, 
-                                         __u16 bcdDevice)
+static struct us_unusual_dev* us_find_dev(u16 idVendor, u16 idProduct, 
+                                         u16 bcdDevice)
 {
        struct us_unusual_dev* ptr;
 
@@ -1488,12 +1475,12 @@
        /* these are temporary copies -- we test on these, then put them
         * in the us-data structure 
         */
-       __u8 ep_in = 0;
-       __u8 ep_out = 0;
-       __u8 ep_int = 0;
-       __u8 ep_interval = 0;
-       __u8 subclass = 0;
-       __u8 protocol = 0;
+       u8 ep_in = 0;
+       u8 ep_out = 0;
+       u8 ep_int = 0;
+       u8 ep_interval = 0;
+       u8 subclass = 0;
+       u8 protocol = 0;
 
        /* the altsettting 0 on the interface we're probing */
        struct usb_interface_descriptor *altsetting = 
@@ -1881,7 +1868,6 @@
        /* initialize internal global data elements */
        us_list = NULL;
        init_MUTEX(&us_list_semaphore);
-       my_host_number = 0;
 
        /* register the driver, return -1 if error */
        if (usb_register(&storage_driver) < 0)

-- 
I'm [EMAIL PROTECTED] "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents me at [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to