Hi! This converts comments into C-style, and removes unused initializers. I'd like it applied...
On a related note -- how well does it work, particulary with different hosts? It uses 'volatile' quite heavily, and that scares me a lot. Signed-off-by: Pavel Machek <[EMAIL PROTECTED]> diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c @@ -263,8 +263,8 @@ MODULE_LICENSE("Dual BSD/GPL"); * * DO NOT REUSE THESE IDs with any other driver!! Ever!! * Instead: allocate your own, using normal USB-IF procedures. */ -#define DRIVER_VENDOR_ID 0x0525 // NetChip -#define DRIVER_PRODUCT_ID 0xa4a5 // Linux-USB File-backed Storage Gadget +#define DRIVER_VENDOR_ID 0x0525 /* NetChip */ +#define DRIVER_PRODUCT_ID 0xa4a5 /* Linux-USB File-backed Storage Gadget */ /* @@ -335,8 +335,8 @@ MODULE_LICENSE("Dual BSD/GPL"); #define MAX_LUNS 8 /* Arggh! There should be a module_param_array_named macro! */ -static char *file[MAX_LUNS] = {NULL, }; -static int ro[MAX_LUNS] = {0, }; +static char *file[MAX_LUNS]; +static int ro[MAX_LUNS]; static struct { int num_filenames; @@ -358,14 +358,14 @@ static struct { int protocol_type; char *protocol_name; -} mod_data = { // Default values +} mod_data = { /* Default values */ .transport_parm = "BBB", .protocol_parm = "SCSI", .removable = 0, .can_stall = 1, .vendor = DRIVER_VENDOR_ID, .product = DRIVER_PRODUCT_ID, - .release = 0xffff, // Use controller chip type + .release = 0xffff, /* Use controller chip type */ .buflen = 16384, }; @@ -415,45 +415,45 @@ MODULE_PARM_DESC(buflen, "I/O buffer siz /*-------------------------------------------------------------------------*/ /* USB protocol value = the transport method */ -#define USB_PR_CBI 0x00 // Control/Bulk/Interrupt -#define USB_PR_CB 0x01 // Control/Bulk w/o interrupt -#define USB_PR_BULK 0x50 // Bulk-only +#define USB_PR_CBI 0x00 /* Control/Bulk/Interrupt */ +#define USB_PR_CB 0x01 /* Control/Bulk w/o interrupt */ +#define USB_PR_BULK 0x50 /* Bulk-only */ /* USB subclass value = the protocol encapsulation */ -#define USB_SC_RBC 0x01 // Reduced Block Commands (flash) -#define USB_SC_8020 0x02 // SFF-8020i, MMC-2, ATAPI (CD-ROM) -#define USB_SC_QIC 0x03 // QIC-157 (tape) -#define USB_SC_UFI 0x04 // UFI (floppy) -#define USB_SC_8070 0x05 // SFF-8070i (removable) -#define USB_SC_SCSI 0x06 // Transparent SCSI +#define USB_SC_RBC 0x01 /* Reduced Block Commands (flash) */ +#define USB_SC_8020 0x02 /* SFF-8020i, MMC-2, ATAPI (CD-ROM) */ +#define USB_SC_QIC 0x03 /* QIC-157 (tape) */ +#define USB_SC_UFI 0x04 /* UFI (floppy) */ +#define USB_SC_8070 0x05 /* SFF-8070i (removable) */ +#define USB_SC_SCSI 0x06 /* Transparent SCSI */ /* Bulk-only data structures */ /* Command Block Wrapper */ struct bulk_cb_wrap { - __le32 Signature; // Contains 'USBC' - u32 Tag; // Unique per command id - __le32 DataTransferLength; // Size of the data - u8 Flags; // Direction in bit 7 - u8 Lun; // LUN (normally 0) - u8 Length; // Of the CDB, <= MAX_COMMAND_SIZE - u8 CDB[16]; // Command Data Block + __le32 Signature; /* Contains 'USBC' */ + u32 Tag; /* Unique per command id */ + __le32 DataTransferLength; /* Size of the data */ + u8 Flags; /* Direction in bit 7 */ + u8 Lun; /* LUN (normally 0) */ + u8 Length; /* Of the CDB, <= MAX_COMMAND_SIZE */ + u8 CDB[16]; /* Command Data Block */ }; #define USB_BULK_CB_WRAP_LEN 31 -#define USB_BULK_CB_SIG 0x43425355 // Spells out USBC +#define USB_BULK_CB_SIG 0x43425355 /* Spells out USBC */ #define USB_BULK_IN_FLAG 0x80 /* Command Status Wrapper */ struct bulk_cs_wrap { - __le32 Signature; // Should = 'USBS' - u32 Tag; // Same as original command - __le32 Residue; // Amount not transferred - u8 Status; // See below + __le32 Signature; /* Should = 'USBS' */ + u32 Tag; /* Same as original command */ + __le32 Residue; /* Amount not transferred */ + u8 Status; /* See below */ }; #define USB_BULK_CS_WRAP_LEN 13 -#define USB_BULK_CS_SIG 0x53425355 // Spells out 'USBS' +#define USB_BULK_CS_SIG 0x53425355 /* Spells out 'USBS' */ #define USB_STATUS_PASS 0 #define USB_STATUS_FAIL 1 #define USB_STATUS_PHASE_ERROR 2 @@ -475,7 +475,7 @@ struct interrupt_data { #define USB_CBI_ADSC_REQUEST 0x00 -#define MAX_COMMAND_SIZE 16 // Length of a SCSI Command Data Block +#define MAX_COMMAND_SIZE 16 /* Length of a SCSI Command Data Block */ /* SCSI commands that we recognize */ #define SC_FORMAT_UNIT 0x04 @@ -518,7 +518,7 @@ struct interrupt_data { #define SS_WRITE_ERROR 0x030c02 #define SS_WRITE_PROTECTED 0x072700 -#define SK(x) ((u8) ((x) >> 16)) // Sense Key byte, etc. +#define SK(x) ((u8) ((x) >> 16)) /* Sense Key byte, etc. */ #define ASC(x) ((u8) ((x) >> 8)) #define ASCQ(x) ((u8) (x)) @@ -573,7 +573,7 @@ static inline struct lun *dev_to_lun(str /* Big enough to hold our biggest descriptor */ #define EP0_BUFSIZE 256 -#define DELAYED_STATUS (EP0_BUFSIZE + 999) // An impossibly large value +#define DELAYED_STATUS (EP0_BUFSIZE + 999) /* An impossibly large value */ /* Number of buffers we will use. 2 is enough for double-buffering */ #define NUM_BUFFERS 2 @@ -602,7 +602,7 @@ struct fsg_buffhd { }; enum fsg_state { - FSG_STATE_COMMAND_PHASE = -10, // This one isn't used anywhere + FSG_STATE_COMMAND_PHASE = -10, /* This one isn't used anywhere */ FSG_STATE_DATA_PHASE, FSG_STATE_STATUS_PHASE, @@ -631,17 +631,17 @@ struct fsg_dev { /* filesem protects: backing files in use */ struct rw_semaphore filesem; - struct usb_ep *ep0; // Handy copy of gadget->ep0 - struct usb_request *ep0req; // For control responses + struct usb_ep *ep0; /* Handy copy of gadget->ep0 */ + struct usb_request *ep0req; /* For control responses */ volatile unsigned int ep0_req_tag; const char *ep0req_name; - struct usb_request *intreq; // For interrupt responses + struct usb_request *intreq; /* For interrupt responses */ volatile int intreq_busy; struct fsg_buffhd *intr_buffhd; unsigned int bulk_out_maxpacket; - enum fsg_state state; // For exception handling + enum fsg_state state; /* For exception handling */ unsigned int exception_req_tag; u8 config, new_config; @@ -868,7 +868,7 @@ config_desc = { .bConfigurationValue = CONFIG_VALUE, .iConfiguration = STRING_CONFIG, .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER, - .bMaxPower = 1, // self-powered + .bMaxPower = 1, /* self-powered */ }; static struct usb_otg_descriptor @@ -1482,7 +1482,7 @@ static int fsg_setup(struct usb_gadget * int rc; int w_length = le16_to_cpu(ctrl->wLength); - ++fsg->ep0_req_tag; // Record arrival of a new request + ++fsg->ep0_req_tag; /* Record arrival of a new request */ fsg->ep0req->context = NULL; fsg->ep0req->length = 0; dump_msg(fsg, "ep0-setup", (u8 *) ctrl, sizeof(*ctrl)); @@ -3328,10 +3328,10 @@ static void handle_exception(struct fsg_ if (transport_is_bbb()) { if (fsg->ep0_req_tag == exception_req_tag) - ep0_queue(fsg); // Complete the status stage + ep0_queue(fsg); /* Complete the status stage */ } else if (transport_is_cbi()) - send_status(fsg); // Status by interrupt pipe + send_status(fsg); /* Status by interrupt pipe */ /* Technically this should go here, but it would only be * a waste of time. Ditto for the INTERFACE_CHANGE and -- Thanks, Sharp! ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel