]> err.no Git - linux-2.6/blobdiff - drivers/usb/storage/jumpshot.c
USB: drivers/usb/storage/sddr55.c: fix uninitialized var warnings
[linux-2.6] / drivers / usb / storage / jumpshot.c
index aff9d51c327cd2ee0d770417e62a70be80acfb84..61097cbb1585047e6893a8f59aec52de4771afdc 100644 (file)
@@ -47,7 +47,6 @@
   * in that routine.
   */
 
-#include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
 
@@ -120,7 +119,8 @@ static int jumpshot_read_data(struct us_data *us,
        unsigned char  thistime;
        unsigned int totallen, alloclen;
        int len, result;
-       unsigned int sg_idx = 0, sg_offset = 0;
+       unsigned int sg_offset = 0;
+       struct scatterlist *sg = NULL;
 
        // we're working in LBA mode.  according to the ATA spec, 
        // we can support up to 28-bit addressing.  I don't know if Jumpshot
@@ -171,7 +171,7 @@ static int jumpshot_read_data(struct us_data *us,
 
                // Store the data in the transfer buffer
                usb_stor_access_xfer_buf(buffer, len, us->srb,
-                                &sg_idx, &sg_offset, TO_XFER_BUF);
+                                &sg, &sg_offset, TO_XFER_BUF);
 
                sector += thistime;
                totallen -= len;
@@ -196,7 +196,8 @@ static int jumpshot_write_data(struct us_data *us,
        unsigned char  thistime;
        unsigned int totallen, alloclen;
        int len, result, waitcount;
-       unsigned int sg_idx = 0, sg_offset = 0;
+       unsigned int sg_offset = 0;
+       struct scatterlist *sg = NULL;
 
        // we're working in LBA mode.  according to the ATA spec, 
        // we can support up to 28-bit addressing.  I don't know if Jumpshot
@@ -226,7 +227,7 @@ static int jumpshot_write_data(struct us_data *us,
 
                // Get the data from the transfer buffer
                usb_stor_access_xfer_buf(buffer, len, us->srb,
-                               &sg_idx, &sg_offset, FROM_XFER_BUF);
+                               &sg, &sg_offset, FROM_XFER_BUF);
 
                command[0] = 0;
                command[1] = thistime;
@@ -441,12 +442,11 @@ int jumpshot_transport(struct scsi_cmnd * srb, struct us_data *us)
        };
 
        if (!us->extra) {
-               us->extra = kmalloc(sizeof(struct jumpshot_info), GFP_NOIO);
+               us->extra = kzalloc(sizeof(struct jumpshot_info), GFP_NOIO);
                if (!us->extra) {
                        US_DEBUGP("jumpshot_transport:  Gah! Can't allocate storage for jumpshot info struct!\n");
                        return USB_STOR_TRANSPORT_ERROR;
                }
-               memset(us->extra, 0, sizeof(struct jumpshot_info));
                us->extra_destructor = jumpshot_info_destructor;
        }