This patch changes to SAM_STAT_ result codes, which is (a) preferred, according to the code comments, and (b) removes some odd-looking bit-shifting.
Greg, please apply.
Matt
# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.693 -> 1.694
# drivers/usb/storage/datafab.c 1.16 -> 1.17
# drivers/usb/storage/jumpshot.c 1.19 -> 1.20
# drivers/usb/storage/transport.c 1.80 -> 1.81
# drivers/usb/storage/protocol.c 1.9 -> 1.10
# drivers/usb/storage/isd200.c 1.28 -> 1.29
# drivers/usb/storage/usb.c 1.69 -> 1.70
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/06/01 [EMAIL PROTECTED] 1.694
# Change to SAM_STAT_* codes, which removes a number of odd-looking 1-bit
# shifts.
# --------------------------------------------
#
diff -Nru a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c
--- a/drivers/usb/storage/datafab.c Sun Jun 1 19:24:07 2003
+++ b/drivers/usb/storage/datafab.c Sun Jun 1 19:24:07 2003
@@ -670,7 +670,7 @@
srb->result = SUCCESS;
} else {
info->sense_key = UNIT_ATTENTION;
- srb->result = CHECK_CONDITION << 1;
+ srb->result = SAM_STAT_CHECK_CONDITION;
}
return rc;
}
diff -Nru a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
--- a/drivers/usb/storage/isd200.c Sun Jun 1 19:24:07 2003
+++ b/drivers/usb/storage/isd200.c Sun Jun 1 19:24:07 2003
@@ -558,7 +558,7 @@
case USB_STOR_TRANSPORT_GOOD:
/* Indicate a good result */
- srb->result = GOOD << 1;
+ srb->result = SAM_STAT_GOOD;
break;
case USB_STOR_TRANSPORT_FAILED:
@@ -598,11 +598,11 @@
}
if (result == ISD200_GOOD) {
isd200_build_sense(us, srb);
- srb->result = CHECK_CONDITION << 1;
+ srb->result = SAM_STAT_CHECK_CONDITION;
/* If things are really okay, then let's show that */
if ((srb->sense_buffer[2] & 0xf) == 0x0)
- srb->result = GOOD << 1;
+ srb->result = SAM_STAT_GOOD;
} else
srb->result = DID_ERROR << 16;
}
@@ -611,7 +611,7 @@
* condition, show that in the result code
*/
if (transferStatus == USB_STOR_TRANSPORT_FAILED)
- srb->result = CHECK_CONDITION << 1;
+ srb->result = SAM_STAT_CHECK_CONDITION;
}
#ifdef CONFIG_USB_STORAGE_DEBUG
@@ -1185,7 +1185,7 @@
/* copy InquiryData */
isd200_data_copy(srb, (char *) &info->InquiryData,
srb->request_bufflen);
- srb->result = GOOD << 1;
+ srb->result = SAM_STAT_GOOD;
sendToTransport = FALSE;
break;
@@ -1205,7 +1205,7 @@
srb->request_bufflen = 0;
} else {
US_DEBUGP(" Media Status not supported, just report okay\n");
- srb->result = GOOD << 1;
+ srb->result = SAM_STAT_GOOD;
sendToTransport = FALSE;
}
break;
@@ -1226,7 +1226,7 @@
srb->request_bufflen = 0;
} else {
US_DEBUGP(" Media Status not supported, just report okay\n");
- srb->result = GOOD << 1;
+ srb->result = SAM_STAT_GOOD;
sendToTransport = FALSE;
}
break;
@@ -1252,7 +1252,7 @@
srb->request_bufflen = sizeof(struct read_capacity_data);
isd200_data_copy(srb, (char *) &readCapacityData,
srb->request_bufflen);
- srb->result = GOOD << 1;
+ srb->result = SAM_STAT_GOOD;
sendToTransport = FALSE;
}
break;
@@ -1336,7 +1336,7 @@
srb->request_bufflen = 0;
} else {
US_DEBUGP(" Not removeable media, just report okay\n");
- srb->result = GOOD << 1;
+ srb->result = SAM_STAT_GOOD;
sendToTransport = FALSE;
}
break;
@@ -1365,7 +1365,7 @@
srb->request_bufflen = 0;
} else {
US_DEBUGP(" Nothing to do, just report okay\n");
- srb->result = GOOD << 1;
+ srb->result = SAM_STAT_GOOD;
sendToTransport = FALSE;
}
break;
diff -Nru a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c
--- a/drivers/usb/storage/jumpshot.c Sun Jun 1 19:24:07 2003
+++ b/drivers/usb/storage/jumpshot.c Sun Jun 1 19:24:07 2003
@@ -611,7 +611,7 @@
srb->result = SUCCESS;
} else {
info->sense_key = UNIT_ATTENTION;
- srb->result = CHECK_CONDITION << 1;
+ srb->result = SAM_STAT_CHECK_CONDITION;
}
return rc;
}
diff -Nru a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c
--- a/drivers/usb/storage/protocol.c Sun Jun 1 19:24:07 2003
+++ b/drivers/usb/storage/protocol.c Sun Jun 1 19:24:07 2003
@@ -137,8 +137,7 @@
/* send the command to the transport layer */
usb_stor_invoke_transport(srb, us);
- if (srb->result == GOOD << 1) {
-
+ if (srb->result == SAM_STAT_GOOD) {
/* fix the INQUIRY data if necessary */
fix_inquiry_data(srb);
}
@@ -210,7 +209,7 @@
/* send the command to the transport layer */
usb_stor_invoke_transport(srb, us);
- if (srb->result == GOOD << 1) {
+ if (srb->result == SAM_STAT_GOOD) {
/* Fix the MODE_SENSE data if we translated the command */
if (old_cmnd == MODE_SENSE)
@@ -307,7 +306,7 @@
/* send the command to the transport layer */
usb_stor_invoke_transport(srb, us);
- if (srb->result == GOOD << 1) {
+ if (srb->result == SAM_STAT_GOOD) {
/* Fix the MODE_SENSE data if we translated the command */
if (old_cmnd == MODE_SENSE)
@@ -376,7 +375,7 @@
/* send the command to the transport layer */
usb_stor_invoke_transport(srb, us);
- if (srb->result == GOOD << 1) {
+ if (srb->result == SAM_STAT_GOOD) {
/* Fix the MODE_SENSE data if we translated the command */
if ((us->flags & US_FL_MODE_XLATE) && (old_cmnd == MODE_SENSE))
diff -Nru a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
--- a/drivers/usb/storage/transport.c Sun Jun 1 19:24:07 2003
+++ b/drivers/usb/storage/transport.c Sun Jun 1 19:24:07 2003
@@ -669,19 +669,19 @@
#endif
/* set the result so the higher layers expect this data */
- srb->result = CHECK_CONDITION << 1;
+ srb->result = SAM_STAT_CHECK_CONDITION;
/* If things are really okay, then let's show that */
if ((srb->sense_buffer[2] & 0xf) == 0x0)
- srb->result = GOOD << 1;
+ srb->result = SAM_STAT_GOOD;
} else /* if (need_auto_sense) */
- srb->result = GOOD << 1;
+ srb->result = SAM_STAT_GOOD;
/* Regardless of auto-sense, if we _know_ we have an error
* condition, show that in the result code
*/
if (result == USB_STOR_TRANSPORT_FAILED)
- srb->result = CHECK_CONDITION << 1;
+ srb->result = SAM_STAT_CHECK_CONDITION;
/* If we think we're good, then make sure the sense data shows it.
* This is necessary because the auto-sense for some devices always
diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
--- a/drivers/usb/storage/usb.c Sun Jun 1 19:24:07 2003
+++ b/drivers/usb/storage/usb.c Sun Jun 1 19:24:07 2003
@@ -373,7 +373,7 @@
memcpy(us->srb->sense_buffer,
usb_stor_sense_invalidCDB,
sizeof(usb_stor_sense_invalidCDB));
- us->srb->result = CHECK_CONDITION << 1;
+ us->srb->result = SAM_STAT_CHECK_CONDITION;
}
/* Handle those devices which need us to fake
@@ -386,7 +386,7 @@
US_DEBUGP("Faking INQUIRY command\n");
fill_inquiry_response(us, data_ptr, 36);
- us->srb->result = GOOD << 1;
+ us->srb->result = SAM_STAT_GOOD;
}
/* we've got a command, let's do it! */
--
Matthew Dharm Home: [EMAIL PROTECTED]
Maintainer, Linux USB Mass Storage Driver
I want my GPFs!!!
-- Stef
User Friendly, 11/9/1998
pgp00000.pgp
Description: PGP signature
