This is some cosmetic cleanups. Things like changing dr to cr (they used to stand for usb_devrequest, which is now usb_ctrlrequest), using strlcpy instead of strncpy, and modifying some comments.
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.720 -> 1.721
# drivers/usb/storage/usb.h 1.39 -> 1.40
# drivers/usb/storage/transport.c 1.88 -> 1.89
# drivers/usb/storage/usb.c 1.79 -> 1.80
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/06/28 [EMAIL PROTECTED] 1.721
# Cosmetic cleanups.
# --------------------------------------------
#
diff -Nru a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
--- a/drivers/usb/storage/transport.c Sat Jun 28 20:31:47 2003
+++ b/drivers/usb/storage/transport.c Sat Jun 28 20:31:48 2003
@@ -207,15 +207,15 @@
value, index, size);
/* fill in the devrequest structure */
- us->dr->bRequestType = requesttype;
- us->dr->bRequest = request;
- us->dr->wValue = cpu_to_le16(value);
- us->dr->wIndex = cpu_to_le16(index);
- us->dr->wLength = cpu_to_le16(size);
+ us->cr->bRequestType = requesttype;
+ us->cr->bRequest = request;
+ us->cr->wValue = cpu_to_le16(value);
+ us->cr->wIndex = cpu_to_le16(index);
+ us->cr->wLength = cpu_to_le16(size);
/* fill and submit the URB */
usb_fill_control_urb(us->current_urb, us->pusb_dev, pipe,
- (unsigned char*) us->dr, data, size,
+ (unsigned char*) us->cr, data, size,
usb_stor_blocking_completion, NULL);
status = usb_stor_msg_common(us, timeout);
@@ -346,15 +346,15 @@
value, index, size);
/* fill in the devrequest structure */
- us->dr->bRequestType = requesttype;
- us->dr->bRequest = request;
- us->dr->wValue = cpu_to_le16(value);
- us->dr->wIndex = cpu_to_le16(index);
- us->dr->wLength = cpu_to_le16(size);
+ us->cr->bRequestType = requesttype;
+ us->cr->bRequest = request;
+ us->cr->wValue = cpu_to_le16(value);
+ us->cr->wIndex = cpu_to_le16(index);
+ us->cr->wLength = cpu_to_le16(size);
/* fill and submit the URB */
usb_fill_control_urb(us->current_urb, us->pusb_dev, pipe,
- (unsigned char*) us->dr, data, size,
+ (unsigned char*) us->cr, data, size,
usb_stor_blocking_completion, NULL);
result = usb_stor_msg_common(us, 0);
diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
--- a/drivers/usb/storage/usb.c Sat Jun 28 20:31:48 2003
+++ b/drivers/usb/storage/usb.c Sat Jun 28 20:31:48 2003
@@ -513,15 +513,15 @@
/* Use the unusual_dev strings if the device didn't provide them */
if (strlen(us->vendor) == 0) {
if (unusual_dev->vendorName)
- strncpy(us->vendor, unusual_dev->vendorName,
- sizeof(us->vendor) - 1);
+ strlcpy(us->vendor, unusual_dev->vendorName,
+ sizeof(us->vendor));
else
strcpy(us->vendor, "Unknown");
}
if (strlen(us->product) == 0) {
if (unusual_dev->productName)
- strncpy(us->product, unusual_dev->productName,
- sizeof(us->product) - 1);
+ strlcpy(us->product, unusual_dev->productName,
+ sizeof(us->product));
else
strcpy(us->product, "Unknown");
}
@@ -743,8 +743,8 @@
int p;
/* Allocate the USB control blocks */
- us->dr = kmalloc(sizeof(*us->dr), GFP_KERNEL);
- if (!us->dr) {
+ us->cr = kmalloc(sizeof(*us->cr), GFP_KERNEL);
+ if (!us->cr) {
US_DEBUGP("usb_ctrlrequest allocation failed\n");
return -ENOMEM;
}
@@ -860,8 +860,8 @@
kfree(us->iobuf);
if (us->current_urb)
usb_free_urb(us->current_urb);
- if (us->dr)
- kfree(us->dr);
+ if (us->cr)
+ kfree(us->cr);
/* Free the structure itself */
kfree(us);
diff -Nru a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
--- a/drivers/usb/storage/usb.h Sat Jun 28 20:31:47 2003
+++ b/drivers/usb/storage/usb.h Sat Jun 28 20:31:47 2003
@@ -108,6 +108,7 @@
struct semaphore dev_semaphore; /* protect pusb_dev */
struct usb_device *pusb_dev; /* this usb_device */
struct usb_interface *pusb_intf; /* this interface */
+ struct us_unusual_dev *unusual_dev; /* device-filter entry */
unsigned long flags; /* from filter initially */
unsigned int send_bulk_pipe; /* cached pipe values */
unsigned int recv_bulk_pipe;
@@ -142,17 +143,16 @@
int sm_state; /* what we are doing */
/* control and bulk communications data */
- struct urb *current_urb; /* non-int USB requests */
- struct usb_ctrlrequest *dr; /* control requests */
- struct usb_sg_request current_sg; /* scatter-gather USB */
+ struct urb *current_urb; /* USB requests */
+ struct usb_ctrlrequest *cr; /* control requests */
+ struct usb_sg_request current_sg; /* scatter-gather req. */
unsigned char *iobuf; /* I/O buffer */
- /* the semaphore for sleeping the control thread */
- struct semaphore sema; /* to sleep thread on */
-
/* mutual exclusion structures */
+ struct semaphore sema; /* to sleep thread on */
struct completion notify; /* thread begin/end */
- struct us_unusual_dev *unusual_dev; /* If unusual device */
+
+ /* subdriver information */
void *extra; /* Any extra data */
extra_data_destructor extra_destructor;/* extra data destructor */
};
--
Matthew Dharm Home: [EMAIL PROTECTED]
Maintainer, Linux USB Mass Storage Driver
G: Let me guess, you started on the 'net with AOL, right?
C: WOW! d00d! U r leet!
-- Greg and Customer
User Friendly, 2/12/1999
pgp00000.pgp
Description: PGP signature
