[PATCH] Re: [linux-usb-devel] ark3116: receive returns negative

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On May 17 2007 07:58, Greg KH wrote:
>On Thu, May 17, 2007 at 04:51:09PM +0200, Jan Engelhardt wrote:
>> On May 17 2007 16:10, Jan Engelhardt wrote:
>> >Hi Greg,
>> >
>> >>But does the driver seem to work properly?
>> >>Do you get data through the device properly?
>> I have taken a voltmeter and an appropriate testcase program - and yes,
>> at least transmit works.
>> >USB-RS232-GenderChanger-RS232-USB.
>> A faulty setup that is. My bad.
>You forgot the NULL modem inverter :)

Yeah I figured. Screw this legacy tech... Anyway here is the patch
for that printk:


Subject: Fix debug output of ark3116

Fix debug output. Previously, it would output "0xFFFFFFB0" on 32-bit 
archs (and probably "0xFFFFFFFFFFFFFFB0" on 64-bits), because buf is 
taken as signed char, which is promoted to signed int, while %x always 
expects an unsigned int.

Signed-off-by: Jan Engelhardt <[email protected]>

 drivers/usb/serial/ark3116.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/usb/serial/ark3116.c
--- linux-2.6.orig/drivers/usb/serial/ark3116.c
+++ linux-2.6/drivers/usb/serial/ark3116.c
@@ -63,7 +63,8 @@ static inline void ARK3116_RCV(struct us
 				 request, requesttype, value, index,
 				 buf, 0x0000001, 1000);
 	if (result)
-		dbg("%03d < %d bytes [0x%02X]", seq, result, buf[0]);
+		dbg("%03d < %d bytes [0x%02X]", seq, result,
+		    ((unsigned char *)buf)[0]);
 		dbg("%03d < 0 bytes", seq);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux