Commit 169900f9 authored by Peter Chen's avatar Peter Chen Committed by Felipe Balbi
Browse files

usb: misc: usbtest: using the same data format among write/compare/output



Using the same data format "buf[j] = (u8)(i + j)" among
write, compare buf, and console output stage.

Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent a724ddfb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1720,7 +1720,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);
@@ -1752,7 +1752,7 @@ static int ctrl_out(struct usbtest_dev *dev,
		for (j = 0; j < len; 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;
			}