Commit 40abbef1 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Revert "usb:gadget Simplify usb_decode_get_set_descriptor function."



This reverts commit c2af6b07.

It's broken.

Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent de4ad1b1
Loading
Loading
Loading
Loading
+55 −58
Original line number Diff line number Diff line
@@ -105,8 +105,9 @@ static void usb_decode_get_set_descriptor(__u8 bRequestType, __u8 bRequest,
					  __u16 wValue, __u16 wIndex,
					  __u16 wLength, char *str, size_t size)
{
	char *s;

	snprintf(str, size, "%s %s Descriptor(Index = %d, Length = %d)",
		 bRequest == USB_REQ_GET_DESCRIPTOR ? "Get" : "Set",
		 ({ char *s;
			switch (wValue >> 8) {
			case USB_DT_DEVICE:
				s = "Device";
@@ -159,11 +160,7 @@ static void usb_decode_get_set_descriptor(__u8 bRequestType, __u8 bRequest,
			default:
				s = "UNKNOWN";
				break;
	}

	snprintf(str, size, "%s %s Descriptor(Index = %d, Length = %d)",
		bRequest == USB_REQ_GET_DESCRIPTOR ? "Get" : "Set",
		s, wValue & 0xff, wLength);
			} s; }), wValue & 0xff, wLength);
}

static void usb_decode_get_configuration(__u16 wLength, char *str, size_t size)