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

From: Jan Engelhardt
Date: Thu May 17 2007 - 11:19:27 EST



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 <jengelh@xxxxxx>

---
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]);
else
dbg("%03d < 0 bytes", seq);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/