On Fri, Aug 28 2015, Peter Chen wrote: > Using the same data format "buf[j] = (u8)(i + j)" among > write, compare buf, and console output stage. > > Signed-off-by: Peter Chen <peter.chen@xxxxxxxxxxxxx> Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx> > --- > drivers/usb/misc/usbtest.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c > index ed0ca53..481a935 100644 > --- a/drivers/usb/misc/usbtest.c > +++ b/drivers/usb/misc/usbtest.c > @@ -1719,7 +1719,7 @@ static int ctrl_out(struct usbtest_dev *dev, > for (i = 0; i < count; i++) { > /* write patterned data */ > for (j = 0; j < len; j++) > - buf[j] = i + j; > + buf[j] = (u8)(i + j); > retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), > 0x5b, USB_DIR_OUT|USB_TYPE_VENDOR, > 0, 0, buf, len, USB_CTRL_SET_TIMEOUT); > @@ -1749,9 +1749,9 @@ static int ctrl_out(struct usbtest_dev *dev, > > /* fail if we can't verify */ > for (j = 0; j < len; j++) { > - if (buf[j] != (u8) (i + j)) { > + if (buf[j] != (u8)(i + j)) { > ERROR(dev, "ctrl_out, byte %d is %d not %d\n", > - j, buf[j], (u8) i + j); > + j, buf[j], (u8)(i + j)); > retval = -EBADMSG; > break; > } > -- > 1.9.1 > -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, ミハウ “mina86” ナザレヴイツ (o o) ooo +--<mpn@xxxxxxxxxx>--<xmpp:mina86@xxxxxxxxxx>-----ooO--(_)--Ooo-- -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html