Commit cea0dfcf authored by Matthew Dharm's avatar Matthew Dharm Committed by Greg Kroah-Hartman

[PATCH] USB storage: move init of residue to a central place

This patch moves the initialization of the SCSI residue field to be in
just a couple of places, instead of all over the map.  It's code
consolidation.
parent c73c6dea
...@@ -520,7 +520,6 @@ int datafab_transport(Scsi_Cmnd * srb, struct us_data *us) ...@@ -520,7 +520,6 @@ int datafab_transport(Scsi_Cmnd * srb, struct us_data *us)
0x00, 0x80, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x00 0x00, 0x80, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x00
}; };
srb->resid = 0;
if (!us->extra) { if (!us->extra) {
us->extra = kmalloc(sizeof(struct datafab_info), GFP_NOIO); us->extra = kmalloc(sizeof(struct datafab_info), GFP_NOIO);
if (!us->extra) { if (!us->extra) {
......
...@@ -817,6 +817,7 @@ void isd200_invoke_transport( struct us_data *us, ...@@ -817,6 +817,7 @@ void isd200_invoke_transport( struct us_data *us,
int transferStatus; int transferStatus;
/* send the command to the transport layer */ /* send the command to the transport layer */
srb->resid = 0;
transferStatus = isd200_Bulk_transport(us, srb, ataCdb, transferStatus = isd200_Bulk_transport(us, srb, ataCdb,
sizeof(ataCdb->generic)); sizeof(ataCdb->generic));
switch (transferStatus) { switch (transferStatus) {
......
...@@ -464,7 +464,6 @@ int jumpshot_transport(Scsi_Cmnd * srb, struct us_data *us) ...@@ -464,7 +464,6 @@ int jumpshot_transport(Scsi_Cmnd * srb, struct us_data *us)
0x00, 0x80, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x00 0x00, 0x80, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x00
}; };
srb->resid = 0;
if (!us->extra) { if (!us->extra) {
us->extra = kmalloc(sizeof(struct jumpshot_info), GFP_NOIO); us->extra = kmalloc(sizeof(struct jumpshot_info), GFP_NOIO);
if (!us->extra) { if (!us->extra) {
......
...@@ -1372,7 +1372,6 @@ int sddr09_transport(Scsi_Cmnd *srb, struct us_data *us) ...@@ -1372,7 +1372,6 @@ int sddr09_transport(Scsi_Cmnd *srb, struct us_data *us)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
srb->resid = 0;
info = (struct sddr09_card_info *)us->extra; info = (struct sddr09_card_info *)us->extra;
if (!info) { if (!info) {
nand_init_ecc(); nand_init_ecc();
......
...@@ -746,7 +746,6 @@ int sddr55_transport(Scsi_Cmnd *srb, struct us_data *us) ...@@ -746,7 +746,6 @@ int sddr55_transport(Scsi_Cmnd *srb, struct us_data *us)
unsigned short pages; unsigned short pages;
struct sddr55_card_info *info; struct sddr55_card_info *info;
srb->resid = 0;
if (!us->extra) { if (!us->extra) {
us->extra = kmalloc( us->extra = kmalloc(
sizeof(struct sddr55_card_info), GFP_NOIO); sizeof(struct sddr55_card_info), GFP_NOIO);
......
...@@ -775,7 +775,6 @@ int hp8200e_transport(Scsi_Cmnd *srb, struct us_data *us) ...@@ -775,7 +775,6 @@ int hp8200e_transport(Scsi_Cmnd *srb, struct us_data *us)
int i; int i;
char string[64]; char string[64];
srb->resid = 0;
len = srb->request_bufflen; len = srb->request_bufflen;
/* Send A0 (ATA PACKET COMMAND). /* Send A0 (ATA PACKET COMMAND).
......
...@@ -784,6 +784,7 @@ void usb_stor_invoke_transport(Scsi_Cmnd *srb, struct us_data *us) ...@@ -784,6 +784,7 @@ void usb_stor_invoke_transport(Scsi_Cmnd *srb, struct us_data *us)
int result; int result;
/* send the command to the transport layer */ /* send the command to the transport layer */
srb->resid = 0;
result = us->transport(srb, us); result = us->transport(srb, us);
/* if the command gets aborted by the higher layers, we need to /* if the command gets aborted by the higher layers, we need to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment