Greg, please apply this patch from Alan.

Matt

----- Forwarded message from Alan Stern <[EMAIL PROTECTED]> -----

Date: Thu, 31 Jul 2003 16:01:15 -0400 (EDT)
From: Alan Stern <[EMAIL PROTECTED]>
Subject: PATCH: (as62b) Move static string out of initializers.h
To: Matthew Dharm <[EMAIL PROTECTED]>
cc: USB Storage List <[EMAIL PROTECTED]>
X-Spam-Status: No, hits=-4.0 required=5.0 tests=UNIFIED_PATCH,RCVD_IN_ORBZ version=2.11

Matt:

This patch seems to have fallen through the cracks.  It takes a string 
constant defined as a macro in initializers.h and instead makes it a 
static string in initializers.c.  It also subtracts 1 from the sizeof() 
value to avoid transmitting the terminating NUL.

Finally, the patch removes an unnecessary debugging printout -- the value 
printed is an _output_ buffer, so of course it won't change.

Alan Stern


===== initializers.c 1.10 vs edited =====
--- 1.10/drivers/usb/storage/initializers.c     Mon Jul 14 00:43:20 2003
+++ edited/drivers/usb/storage/initializers.c   Tue Jul 15 16:02:26 2003
@@ -55,7 +55,6 @@
                        0x0C, USB_RECIP_INTERFACE | USB_TYPE_VENDOR,
                        0x01, 0x0, us->iobuf, 0x1, 5*HZ);
        US_DEBUGP("-- result is %d\n", result);
-       US_DEBUGP("-- data afterwards is %d\n", us->iobuf[0]);
 
        return 0;
 }
@@ -67,6 +66,7 @@
        struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap*) us->iobuf;
        struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap*) us->iobuf;
        int res, partial;
+       static char init_string[] = "\xec\x0a\x06\x00$PCCHIPS";
 
        US_DEBUGP("Sending UCR-61S2B initialization packet...\n");
 
@@ -74,9 +74,9 @@
        bcb->Tag = 0;
        bcb->DataTransferLength = cpu_to_le32(0);
        bcb->Flags = bcb->Lun = 0;
-       bcb->Length = sizeof(UCR61S2B_INIT);
+       bcb->Length = sizeof(init_string) - 1;
        memset(bcb->CDB, 0, sizeof(bcb->CDB));
-       memcpy(bcb->CDB, UCR61S2B_INIT, sizeof(UCR61S2B_INIT));
+       memcpy(bcb->CDB, init_string, sizeof(init_string) - 1);
 
        res = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcb,
                        US_BULK_CB_WRAP_LEN, &partial);
===== initializers.h 1.7 vs edited =====
--- 1.7/drivers/usb/storage/initializers.h      Wed Jun 25 13:02:56 2003
+++ edited/drivers/usb/storage/initializers.h   Tue Jul 15 15:58:51 2003
@@ -49,8 +49,6 @@
 int sddr09_init(struct us_data *us);
 #endif
 
-#define UCR61S2B_INIT "\xec\x0a\x06\x00$PCCHIPS"
-
 /* This function is required to activate all four slots on the UCR-61S2B
  * flash reader */
 int usb_stor_ucr61s2b_init(struct us_data *us);

----- End forwarded message -----

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

Why am I talking to a toilet brush?
                                        -- CEO
User Friendly, 4/30/1998

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to