Skip to contentSkip to conversation

USB: ch9: add "USB_" prefix in front of TEST defines

PATCH In review Greg Kroah-Hartman 5 participants 5 messages Jun 18, 2020 – Jun 22, 2020

Subsystems (11)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 USB: ch9: add "USB_" prefix in front of TEST defines

For some reason, the TEST_ defines in the usb/ch9.h files did not have the USB_ prefix on it, making it a bit confusing when reading the file, as well as not the nicest thing to do in a uapi file.

So fix that up and add the USB_ prefix on to them, and fix up all in-kernel usages. This included deleting the duplicate copy in the net2272.h file.

Cc Peter Chen <[email protected]>
Cc Minas Harutyunyan <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Michal Simek <[email protected]>
Cc Mathias Nyman <[email protected]>
Cc Chunfeng Yun <[email protected]>
Cc Bin Liu <[email protected]>
Cc Pawel Laszczak <[email protected]>
Cc YueHaibing <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Jason Yan <[email protected]>
Cc Jia-Ju Bai <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Christophe JAILLET <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Jules Irenge <[email protected]>
Cc Alan Stern <[email protected]>
Cc Thinh Nguyen <[email protected]>
Cc Rob Gill <[email protected]>
Cc Macpaul Lin <[email protected]>
---
 drivers/usb/cdns3/ep0.c              |  8 ++++----
 drivers/usb/chipidea/udc.c           | 10 +++++-----
 drivers/usb/common/debug.c           | 10 +++++-----
 drivers/usb/dwc2/debugfs.c           | 20 ++++++++++----------
 drivers/usb/dwc2/gadget.c            | 10 +++++-----
 drivers/usb/dwc3/debugfs.c           | 20 ++++++++++----------
 drivers/usb/dwc3/ep0.c               | 10 +++++-----
 drivers/usb/dwc3/gadget.c            | 10 +++++-----
 drivers/usb/gadget/udc/bdc/bdc_ep.c  | 10 +++++-----
 drivers/usb/gadget/udc/gr_udc.c      |  4 ++--
 drivers/usb/gadget/udc/mv_udc_core.c |  2 +-
 drivers/usb/gadget/udc/net2272.c     |  2 +-
 drivers/usb/gadget/udc/net2272.h     |  5 -----
 drivers/usb/gadget/udc/udc-xilinx.c  |  4 ++--
 drivers/usb/host/xhci-hub.c          |  7 ++++---
 drivers/usb/misc/ehset.c             |  8 ++++----
 drivers/usb/mtu3/mtu3_gadget_ep0.c   | 16 ++++++++--------
 drivers/usb/musb/musb_gadget_ep0.c   | 20 ++++++++------------
 drivers/usb/musb/musb_virthub.c      | 20 ++++++++++----------
 include/uapi/linux/usb/ch9.h         | 10 +++++-----
 20 files changed, 99 insertions(+), 107 deletions(-)
drivers/usb/cdns3/ep0.c +4 -4
index 82645a2a0f52..04a522f5ae58 100644
@@ -328,10 +328,10 @@ static int cdns3_ep0_feature_handle_device(struct cdns3_device *priv_dev,
 			return -EINVAL;
 
 		switch (tmode >> 8) {
-		case TEST_J:
-		case TEST_K:
-		case TEST_SE0_NAK:
-		case TEST_PACKET:
+		case USB_TEST_J:
+		case USB_TEST_K:
+		case USB_TEST_SE0_NAK:
+		case USB_TEST_PACKET:
 			cdns3_set_register_bit(&priv_dev->regs->usb_cmd,
 					       USB_CMD_STMODE |
 					       USB_STS_TMODE_SEL(tmode - 1));
drivers/usb/chipidea/udc.c +5 -5
index db0cfde0cc3c..4beb25888917 100644
@@ -1215,11 +1215,11 @@ __acquires(ci->lock)
 			case USB_DEVICE_TEST_MODE:
 				tmode = le16_to_cpu(req.wIndex) >> 8;
 				switch (tmode) {
-				case TEST_J:
-				case TEST_K:
-				case TEST_SE0_NAK:
-				case TEST_PACKET:
-				case TEST_FORCE_EN:
+				case USB_TEST_J:
+				case USB_TEST_K:
+				case USB_TEST_SE0_NAK:
+				case USB_TEST_PACKET:
+				case USB_TEST_FORCE_ENABLE:
 					ci->test_mode = tmode;
 					err = isr_setup_status_phase(
 							ci);
drivers/usb/common/debug.c +5 -5
index 92a986aeaa5d..410acd670ca7 100644
@@ -53,15 +53,15 @@ static const char *usb_decode_device_feature(u16 wValue)
 static const char *usb_decode_test_mode(u16 wIndex)
 {
 	switch (wIndex) {
-	case TEST_J:
+	case USB_TEST_J:
 		return ": TEST_J";
-	case TEST_K:
+	case USB_TEST_K:
 		return ": TEST_K";
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
 		return ": TEST_SE0_NAK";
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
 		return ": TEST_PACKET";
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
 		return ": TEST_FORCE_EN";
 	default:
 		return ": UNKNOWN";
drivers/usb/dwc2/debugfs.c +10 -10
index 3a0dcbfbc827..aaafd463d72a 100644
@@ -37,15 +37,15 @@ static ssize_t testmode_write(struct file *file, const char __user *ubuf, size_t
 		return -EFAULT;
 
 	if (!strncmp(buf, "test_j", 6))
-		testmode = TEST_J;
+		testmode = USB_TEST_J;
 	else if (!strncmp(buf, "test_k", 6))
-		testmode = TEST_K;
+		testmode = USB_TEST_K;
 	else if (!strncmp(buf, "test_se0_nak", 12))
-		testmode = TEST_SE0_NAK;
+		testmode = USB_TEST_SE0_NAK;
 	else if (!strncmp(buf, "test_packet", 11))
-		testmode = TEST_PACKET;
+		testmode = USB_TEST_PACKET;
 	else if (!strncmp(buf, "test_force_enable", 17))
-		testmode = TEST_FORCE_EN;
+		testmode = USB_TEST_FORCE_ENABLE;
 	else
 		testmode = 0;
 
@@ -78,19 +78,19 @@ static int testmode_show(struct seq_file *s, void *unused)
 	case 0:
 		seq_puts(s, "no test\n");
 		break;
-	case TEST_J:
+	case USB_TEST_J:
 		seq_puts(s, "test_j\n");
 		break;
-	case TEST_K:
+	case USB_TEST_K:
 		seq_puts(s, "test_k\n");
 		break;
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
 		seq_puts(s, "test_se0_nak\n");
 		break;
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
 		seq_puts(s, "test_packet\n");
 		break;
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
 		seq_puts(s, "test_force_enable\n");
 		break;
 	default:
drivers/usb/dwc2/gadget.c +5 -5
index 12b98b466287..38fc46b0c026 100644
@@ -1561,11 +1561,11 @@ int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode)
 
 	dctl &= ~DCTL_TSTCTL_MASK;
 	switch (testmode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		dctl |= testmode << DCTL_TSTCTL_SHIFT;
 		break;
 	default:
drivers/usb/dwc3/debugfs.c +10 -10
index 6d9de334e46a..14dc6a37305d 100644
@@ -466,19 +466,19 @@ static int dwc3_testmode_show(struct seq_file *s, void *unused)
 	case 0:
 		seq_printf(s, "no test\n");
 		break;
-	case TEST_J:
+	case USB_TEST_J:
 		seq_printf(s, "test_j\n");
 		break;
-	case TEST_K:
+	case USB_TEST_K:
 		seq_printf(s, "test_k\n");
 		break;
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
 		seq_printf(s, "test_se0_nak\n");
 		break;
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
 		seq_printf(s, "test_packet\n");
 		break;
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
 		seq_printf(s, "test_force_enable\n");
 		break;
 	default:
@@ -506,15 +506,15 @@ static ssize_t dwc3_testmode_write(struct file *file,
 		return -EFAULT;
 
 	if (!strncmp(buf, "test_j", 6))
-		testmode = TEST_J;
+		testmode = USB_TEST_J;
 	else if (!strncmp(buf, "test_k", 6))
-		testmode = TEST_K;
+		testmode = USB_TEST_K;
 	else if (!strncmp(buf, "test_se0_nak", 12))
-		testmode = TEST_SE0_NAK;
+		testmode = USB_TEST_SE0_NAK;
 	else if (!strncmp(buf, "test_packet", 11))
-		testmode = TEST_PACKET;
+		testmode = USB_TEST_PACKET;
 	else if (!strncmp(buf, "test_force_enable", 17))
-		testmode = TEST_FORCE_EN;
+		testmode = USB_TEST_FORCE_ENABLE;
 	else
 		testmode = 0;
 
drivers/usb/dwc3/ep0.c +5 -5
index 6dee4dabc0a4..8dd69728add3 100644
@@ -425,11 +425,11 @@ static int dwc3_ep0_handle_test(struct dwc3 *dwc, enum usb_device_state state,
 		return -EINVAL;
 
 	switch (wIndex >> 8) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		dwc->test_mode_nr = wIndex >> 8;
 		dwc->test_mode = true;
 		break;
drivers/usb/dwc3/gadget.c +5 -5
index 80c3ef134e41..0b59b2f1cf26 100644
@@ -46,11 +46,11 @@ int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode)
 	reg &= ~DWC3_DCTL_TSTCTRL_MASK;
 
 	switch (mode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		reg |= mode << 1;
 		break;
 	default:
drivers/usb/gadget/udc/bdc/bdc_ep.c +5 -5
index d49c6dc1082d..ba250cf75bef 100644
@@ -927,11 +927,11 @@ static int bdc_set_test_mode(struct bdc *bdc)
 	usb2_pm &= ~BDC_PTC_MASK;
 	dev_dbg(bdc->dev, "%s\n", __func__);
 	switch (bdc->test_mode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		usb2_pm |= bdc->test_mode << 28;
 		break;
 	default:
drivers/usb/gadget/udc/gr_udc.c +2 -2
index 7164ad9800f1..345e28d76709 100644
@@ -912,9 +912,9 @@ static int gr_device_request(struct gr_udc *dev, u8 type, u8 request,
 			return gr_ep0_respond_empty(dev);
 
 		case USB_DEVICE_TEST_MODE:
-			/* The hardware does not support TEST_FORCE_EN */
+			/* The hardware does not support USB_TEST_FORCE_ENABLE */
 			test = index >> 8;
-			if (test >= TEST_J && test <= TEST_PACKET) {
+			if (test >= USB_TEST_J && test <= USB_TEST_PACKET) {
 				dev->test_mode = test;
 				return gr_ep0_respond(dev, NULL, 0,
 						      gr_ep0_testmode_complete);
drivers/usb/gadget/udc/mv_udc_core.c +1 -1
index cafde053788b..69289717d856 100644
@@ -1502,7 +1502,7 @@ udc_prime_status(struct mv_udc *udc, u8 direction, u16 status, bool empty)
 
 static void mv_udc_testmode(struct mv_udc *udc, u16 index)
 {
-	if (index <= TEST_FORCE_EN) {
+	if (index <= USB_TEST_FORCE_ENABLE) {
 		udc->test_mode = index;
 		if (udc_prime_status(udc, EP_DIR_IN, 0, true))
 			ep0_stall(udc);
drivers/usb/gadget/udc/net2272.c +1 -1
index 928057b206f1..fbbe62513545 100644
@@ -1688,7 +1688,7 @@ net2272_set_test_mode(struct net2272 *dev, int mode)
 	net2272_write(dev, USBTEST, mode);
 
 	/* load test packet */
-	if (mode == TEST_PACKET) {
+	if (mode == USB_TEST_PACKET) {
 		/* switch to 8 bit mode */
 		net2272_write(dev, LOCCTL, net2272_read(dev, LOCCTL) &
 				~(1 << DATA_WIDTH));
drivers/usb/gadget/udc/net2272.h +0 -5
index 8e644627992d..87d0ab9ffeeb 100644
@@ -105,11 +105,6 @@
 #define USBTEST				0x32
 #define 	TEST_MODE_SELECT			0
 #define 		NORMAL_OPERATION			0
-#define 		TEST_J					1
-#define 		TEST_K					2
-#define 		TEST_SE0_NAK				3
-#define 		TEST_PACKET				4
-#define 		TEST_FORCE_ENABLE			5
 #define XCVRDIAG			0x33
 #define 	FORCE_FULL_SPEED			2
 #define 	FORCE_HIGH_SPEED			3
drivers/usb/gadget/udc/udc-xilinx.c +2 -2
index 709553bdb233..d5e9d20c097d 100644
@@ -2097,9 +2097,9 @@ static int xudc_probe(struct platform_device *pdev)
 	/* Check for IP endianness */
 	udc->write_fn = xudc_write32_be;
 	udc->read_fn = xudc_read32_be;
-	udc->write_fn(udc->addr, XUSB_TESTMODE_OFFSET, TEST_J);
+	udc->write_fn(udc->addr, XUSB_TESTMODE_OFFSET, USB_TEST_J);
 	if ((udc->read_fn(udc->addr + XUSB_TESTMODE_OFFSET))
-			!= TEST_J) {
+			!= USB_TEST_J) {
 		udc->write_fn = xudc_write32;
 		udc->read_fn = xudc_read32;
 	}
drivers/usb/host/xhci-hub.c +4 -3
index f37316d2c8fa..073c54e42223 100644
@@ -612,7 +612,7 @@ static void xhci_port_set_test_mode(struct xhci_hcd *xhci,
 	temp |= test_mode << PORT_TEST_MODE_SHIFT;
 	writel(temp, port->addr + PORTPMSC);
 	xhci->test_mode = test_mode;
-	if (test_mode == TEST_FORCE_EN)
+	if (test_mode == USB_TEST_FORCE_ENABLE)
 		xhci_start(xhci);
 }
 
@@ -666,7 +666,7 @@ static int xhci_exit_test_mode(struct xhci_hcd *xhci)
 		xhci_err(xhci, "Not in test mode, do nothing.\n");
 		return 0;
 	}
-	if (xhci->test_mode == TEST_FORCE_EN &&
+	if (xhci->test_mode == USB_TEST_FORCE_ENABLE &&
 		!(xhci->xhc_state & XHCI_STATE_HALTED)) {
 		retval = xhci_halt(xhci);
 		if (retval)
@@ -1421,7 +1421,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 			/* 4.19.6 Port Test Modes (USB2 Test Mode) */
 			if (hcd->speed != HCD_USB2)
 				goto error;
-			if (test_mode > TEST_FORCE_EN || test_mode < TEST_J)
+			if (test_mode > USB_TEST_FORCE_ENABLE ||
+			    test_mode < USB_TEST_J)
 				goto error;
 			retval = xhci_enter_test_mode(xhci, test_mode, wIndex,
 						      &flags);
drivers/usb/misc/ehset.c +4 -4
index 7895d61e733b..2752e1f4f4d0 100644
@@ -33,28 +33,28 @@ static int ehset_probe(struct usb_interface *intf,
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_SE0_NAK << 8) | portnum,
+					(USB_TEST_SE0_NAK << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_J_PID:
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_J << 8) | portnum,
+					(USB_TEST_J << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_K_PID:
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_K << 8) | portnum,
+					(USB_TEST_K << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_PACKET_PID:
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_PACKET << 8) | portnum,
+					(USB_TEST_PACKET << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_HS_HOST_PORT_SUSPEND_RESUME:
drivers/usb/mtu3/mtu3_gadget_ep0.c +8 -8
index 2be182bd793a..563a0a2e970d 100644
@@ -278,20 +278,20 @@ static int handle_test_mode(struct mtu3 *mtu, struct usb_ctrlrequest *setup)
 	u32 value;
 
 	switch (le16_to_cpu(setup->wIndex) >> 8) {
-	case TEST_J:
-		dev_dbg(mtu->dev, "TEST_J\n");
+	case USB_TEST_J:
+		dev_dbg(mtu->dev, "USB_TEST_J\n");
 		mtu->test_mode_nr = TEST_J_MODE;
 		break;
-	case TEST_K:
-		dev_dbg(mtu->dev, "TEST_K\n");
+	case USB_TEST_K:
+		dev_dbg(mtu->dev, "USB_TEST_K\n");
 		mtu->test_mode_nr = TEST_K_MODE;
 		break;
-	case TEST_SE0_NAK:
-		dev_dbg(mtu->dev, "TEST_SE0_NAK\n");
+	case USB_TEST_SE0_NAK:
+		dev_dbg(mtu->dev, "USB_TEST_SE0_NAK\n");
 		mtu->test_mode_nr = TEST_SE0_NAK_MODE;
 		break;
-	case TEST_PACKET:
-		dev_dbg(mtu->dev, "TEST_PACKET\n");
+	case USB_TEST_PACKET:
+		dev_dbg(mtu->dev, "USB_TEST_PACKET\n");
 		mtu->test_mode_nr = TEST_PACKET_MODE;
 		break;
 	default:
drivers/usb/musb/musb_gadget_ep0.c +8 -12
index 91a5027b5c1f..0ae3e0be043e 100644
@@ -311,27 +311,23 @@ __acquires(musb->lock)
 						goto stall;
 
 					switch (ctrlrequest->wIndex >> 8) {
-					case 1:
-						pr_debug("TEST_J\n");
-						/* TEST_J */
+					case USB_TEST_J:
+						pr_debug("USB_TEST_J\n");
 						musb->test_mode_nr =
 							MUSB_TEST_J;
 						break;
-					case 2:
-						/* TEST_K */
-						pr_debug("TEST_K\n");
+					case USB_TEST_K:
+						pr_debug("USB_TEST_K\n");
 						musb->test_mode_nr =
 							MUSB_TEST_K;
 						break;
-					case 3:
-						/* TEST_SE0_NAK */
-						pr_debug("TEST_SE0_NAK\n");
+					case USB_TEST_SE0_NAK:
+						pr_debug("USB_TEST_SE0_NAK\n");
 						musb->test_mode_nr =
 							MUSB_TEST_SE0_NAK;
 						break;
-					case 4:
-						/* TEST_PACKET */
-						pr_debug("TEST_PACKET\n");
+					case USB_TEST_PACKET:
+						pr_debug("USB_TEST_PACKET\n");
 						musb->test_mode_nr =
 							MUSB_TEST_PACKET;
 						break;
drivers/usb/musb/musb_virthub.c +10 -10
index a84ec27c4c12..cb7ae297a3af 100644
@@ -385,25 +385,25 @@ int musb_hub_control(
 
 			wIndex >>= 8;
 			switch (wIndex) {
-			case 1:
-				pr_debug("TEST_J\n");
+			case USB_TEST_J:
+				pr_debug("USB_TEST_J\n");
 				temp = MUSB_TEST_J;
 				break;
-			case 2:
-				pr_debug("TEST_K\n");
+			case USB_TEST_K:
+				pr_debug("USB_TEST_K\n");
 				temp = MUSB_TEST_K;
 				break;
-			case 3:
-				pr_debug("TEST_SE0_NAK\n");
+			case USB_TEST_SE0_NAK:
+				pr_debug("USB_TEST_SE0_NAK\n");
 				temp = MUSB_TEST_SE0_NAK;
 				break;
-			case 4:
-				pr_debug("TEST_PACKET\n");
+			case USB_TEST_PACKET:
+				pr_debug("USB_TEST_PACKET\n");
 				temp = MUSB_TEST_PACKET;
 				musb_load_testpacket(musb);
 				break;
-			case 5:
-				pr_debug("TEST_FORCE_ENABLE\n");
+			case USB_TEST_FORCE_ENABLE:
+				pr_debug("USB_TEST_FORCE_ENABLE\n");
 				temp = MUSB_TEST_FORCE_HOST
 					| MUSB_TEST_FORCE_HS;
 
include/uapi/linux/usb/ch9.h +5 -5
index b1ed2ccfe9cf..48766fdf6580 100644
@@ -138,11 +138,11 @@
  * Test Mode Selectors
  * See USB 2.0 spec Table 9-7
  */
-#define	TEST_J		1
-#define	TEST_K		2
-#define	TEST_SE0_NAK	3
-#define	TEST_PACKET	4
-#define	TEST_FORCE_EN	5
+#define	USB_TEST_J		1
+#define	USB_TEST_K		2
+#define	USB_TEST_SE0_NAK	3
+#define	USB_TEST_PACKET		4
+#define	USB_TEST_FORCE_ENABLE	5
 
 /* Status Type */
 #define USB_STATUS_TYPE_STANDARD	0
Signature · 1 line
2.27.0
Acked-by on v1 1/1
#1 lore raw
Quoted 29 lines · Greg Kroah-Hartman

For some reason, the TEST_ defines in the usb/ch9.h files did not have the USB_ prefix on it, making it a bit confusing when reading the file, as well as not the nicest thing to do in a uapi file.

So fix that up and add the USB_ prefix on to them, and fix up all in-kernel usages. This included deleting the duplicate copy in the net2272.h file.

Cc Peter Chen <[email protected]>
Cc Minas Harutyunyan <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Michal Simek <[email protected]>
Cc Mathias Nyman <[email protected]>
Cc Chunfeng Yun <[email protected]>
Cc Bin Liu <[email protected]>
Cc Pawel Laszczak <[email protected]>
Cc YueHaibing <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Jason Yan <[email protected]>
Cc Jia-Ju Bai <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Christophe JAILLET <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Jules Irenge <[email protected]>
Cc Alan Stern <[email protected]>
Cc Thinh Nguyen <[email protected]>
Cc Rob Gill <[email protected]>
Cc Macpaul Lin <[email protected]>
Quoted 3 lines
---
 drivers/usb/cdns3/ep0.c              |  8 ++++----
 drivers/usb/chipidea/udc.c           | 10 +++++-----

For cdns3 and chipidea parts:

Peter

Quoted 549 lines
 drivers/usb/common/debug.c           | 10 +++++-----
 drivers/usb/dwc2/debugfs.c           | 20 ++++++++++----------
 drivers/usb/dwc2/gadget.c            | 10 +++++-----
 drivers/usb/dwc3/debugfs.c           | 20 ++++++++++----------
 drivers/usb/dwc3/ep0.c               | 10 +++++-----
 drivers/usb/dwc3/gadget.c            | 10 +++++-----
 drivers/usb/gadget/udc/bdc/bdc_ep.c  | 10 +++++-----
 drivers/usb/gadget/udc/gr_udc.c      |  4 ++--
 drivers/usb/gadget/udc/mv_udc_core.c |  2 +-
 drivers/usb/gadget/udc/net2272.c     |  2 +-
 drivers/usb/gadget/udc/net2272.h     |  5 -----
 drivers/usb/gadget/udc/udc-xilinx.c  |  4 ++--
 drivers/usb/host/xhci-hub.c          |  7 ++++---
 drivers/usb/misc/ehset.c             |  8 ++++----
 drivers/usb/mtu3/mtu3_gadget_ep0.c   | 16 ++++++++--------
 drivers/usb/musb/musb_gadget_ep0.c   | 20 ++++++++------------
 drivers/usb/musb/musb_virthub.c      | 20 ++++++++++----------
 include/uapi/linux/usb/ch9.h         | 10 +++++-----
 20 files changed, 99 insertions(+), 107 deletions(-)
drivers/usb/cdns3/ep0.c +4 -4
index 82645a2a0f52..04a522f5ae58 100644
@@ -328,10 +328,10 @@ static int cdns3_ep0_feature_handle_device(struct cdns3_device *priv_dev,
 			return -EINVAL;
 
 		switch (tmode >> 8) {
-		case TEST_J:
-		case TEST_K:
-		case TEST_SE0_NAK:
-		case TEST_PACKET:
+		case USB_TEST_J:
+		case USB_TEST_K:
+		case USB_TEST_SE0_NAK:
+		case USB_TEST_PACKET:
 			cdns3_set_register_bit(&priv_dev->regs->usb_cmd,
 					       USB_CMD_STMODE |
 					       USB_STS_TMODE_SEL(tmode - 1));
drivers/usb/chipidea/udc.c +5 -5
index db0cfde0cc3c..4beb25888917 100644
@@ -1215,11 +1215,11 @@ __acquires(ci->lock)
 			case USB_DEVICE_TEST_MODE:
 				tmode = le16_to_cpu(req.wIndex) >> 8;
 				switch (tmode) {
-				case TEST_J:
-				case TEST_K:
-				case TEST_SE0_NAK:
-				case TEST_PACKET:
-				case TEST_FORCE_EN:
+				case USB_TEST_J:
+				case USB_TEST_K:
+				case USB_TEST_SE0_NAK:
+				case USB_TEST_PACKET:
+				case USB_TEST_FORCE_ENABLE:
 					ci->test_mode = tmode;
 					err = isr_setup_status_phase(
 							ci);
drivers/usb/common/debug.c +5 -5
index 92a986aeaa5d..410acd670ca7 100644
@@ -53,15 +53,15 @@ static const char *usb_decode_device_feature(u16 wValue)
 static const char *usb_decode_test_mode(u16 wIndex)
 {
 	switch (wIndex) {
-	case TEST_J:
+	case USB_TEST_J:
 		return ": TEST_J";
-	case TEST_K:
+	case USB_TEST_K:
 		return ": TEST_K";
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
 		return ": TEST_SE0_NAK";
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
 		return ": TEST_PACKET";
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
 		return ": TEST_FORCE_EN";
 	default:
 		return ": UNKNOWN";
drivers/usb/dwc2/debugfs.c +10 -10
index 3a0dcbfbc827..aaafd463d72a 100644
@@ -37,15 +37,15 @@ static ssize_t testmode_write(struct file *file, const char __user *ubuf, size_t
 		return -EFAULT;
 
 	if (!strncmp(buf, "test_j", 6))
-		testmode = TEST_J;
+		testmode = USB_TEST_J;
 	else if (!strncmp(buf, "test_k", 6))
-		testmode = TEST_K;
+		testmode = USB_TEST_K;
 	else if (!strncmp(buf, "test_se0_nak", 12))
-		testmode = TEST_SE0_NAK;
+		testmode = USB_TEST_SE0_NAK;
 	else if (!strncmp(buf, "test_packet", 11))
-		testmode = TEST_PACKET;
+		testmode = USB_TEST_PACKET;
 	else if (!strncmp(buf, "test_force_enable", 17))
-		testmode = TEST_FORCE_EN;
+		testmode = USB_TEST_FORCE_ENABLE;
 	else
 		testmode = 0;
 
@@ -78,19 +78,19 @@ static int testmode_show(struct seq_file *s, void *unused)
 	case 0:
 		seq_puts(s, "no test\n");
 		break;
-	case TEST_J:
+	case USB_TEST_J:
 		seq_puts(s, "test_j\n");
 		break;
-	case TEST_K:
+	case USB_TEST_K:
 		seq_puts(s, "test_k\n");
 		break;
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
 		seq_puts(s, "test_se0_nak\n");
 		break;
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
 		seq_puts(s, "test_packet\n");
 		break;
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
 		seq_puts(s, "test_force_enable\n");
 		break;
 	default:
drivers/usb/dwc2/gadget.c +5 -5
index 12b98b466287..38fc46b0c026 100644
@@ -1561,11 +1561,11 @@ int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode)
 
 	dctl &= ~DCTL_TSTCTL_MASK;
 	switch (testmode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		dctl |= testmode << DCTL_TSTCTL_SHIFT;
 		break;
 	default:
drivers/usb/dwc3/debugfs.c +10 -10
index 6d9de334e46a..14dc6a37305d 100644
@@ -466,19 +466,19 @@ static int dwc3_testmode_show(struct seq_file *s, void *unused)
 	case 0:
 		seq_printf(s, "no test\n");
 		break;
-	case TEST_J:
+	case USB_TEST_J:
 		seq_printf(s, "test_j\n");
 		break;
-	case TEST_K:
+	case USB_TEST_K:
 		seq_printf(s, "test_k\n");
 		break;
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
 		seq_printf(s, "test_se0_nak\n");
 		break;
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
 		seq_printf(s, "test_packet\n");
 		break;
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
 		seq_printf(s, "test_force_enable\n");
 		break;
 	default:
@@ -506,15 +506,15 @@ static ssize_t dwc3_testmode_write(struct file *file,
 		return -EFAULT;
 
 	if (!strncmp(buf, "test_j", 6))
-		testmode = TEST_J;
+		testmode = USB_TEST_J;
 	else if (!strncmp(buf, "test_k", 6))
-		testmode = TEST_K;
+		testmode = USB_TEST_K;
 	else if (!strncmp(buf, "test_se0_nak", 12))
-		testmode = TEST_SE0_NAK;
+		testmode = USB_TEST_SE0_NAK;
 	else if (!strncmp(buf, "test_packet", 11))
-		testmode = TEST_PACKET;
+		testmode = USB_TEST_PACKET;
 	else if (!strncmp(buf, "test_force_enable", 17))
-		testmode = TEST_FORCE_EN;
+		testmode = USB_TEST_FORCE_ENABLE;
 	else
 		testmode = 0;
 
drivers/usb/dwc3/ep0.c +5 -5
index 6dee4dabc0a4..8dd69728add3 100644
@@ -425,11 +425,11 @@ static int dwc3_ep0_handle_test(struct dwc3 *dwc, enum usb_device_state state,
 		return -EINVAL;
 
 	switch (wIndex >> 8) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		dwc->test_mode_nr = wIndex >> 8;
 		dwc->test_mode = true;
 		break;
drivers/usb/dwc3/gadget.c +5 -5
index 80c3ef134e41..0b59b2f1cf26 100644
@@ -46,11 +46,11 @@ int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode)
 	reg &= ~DWC3_DCTL_TSTCTRL_MASK;
 
 	switch (mode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		reg |= mode << 1;
 		break;
 	default:
drivers/usb/gadget/udc/bdc/bdc_ep.c +5 -5
index d49c6dc1082d..ba250cf75bef 100644
@@ -927,11 +927,11 @@ static int bdc_set_test_mode(struct bdc *bdc)
 	usb2_pm &= ~BDC_PTC_MASK;
 	dev_dbg(bdc->dev, "%s\n", __func__);
 	switch (bdc->test_mode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		usb2_pm |= bdc->test_mode << 28;
 		break;
 	default:
drivers/usb/gadget/udc/gr_udc.c +2 -2
index 7164ad9800f1..345e28d76709 100644
@@ -912,9 +912,9 @@ static int gr_device_request(struct gr_udc *dev, u8 type, u8 request,
 			return gr_ep0_respond_empty(dev);
 
 		case USB_DEVICE_TEST_MODE:
-			/* The hardware does not support TEST_FORCE_EN */
+			/* The hardware does not support USB_TEST_FORCE_ENABLE */
 			test = index >> 8;
-			if (test >= TEST_J && test <= TEST_PACKET) {
+			if (test >= USB_TEST_J && test <= USB_TEST_PACKET) {
 				dev->test_mode = test;
 				return gr_ep0_respond(dev, NULL, 0,
 						      gr_ep0_testmode_complete);
drivers/usb/gadget/udc/mv_udc_core.c +1 -1
index cafde053788b..69289717d856 100644
@@ -1502,7 +1502,7 @@ udc_prime_status(struct mv_udc *udc, u8 direction, u16 status, bool empty)
 
 static void mv_udc_testmode(struct mv_udc *udc, u16 index)
 {
-	if (index <= TEST_FORCE_EN) {
+	if (index <= USB_TEST_FORCE_ENABLE) {
 		udc->test_mode = index;
 		if (udc_prime_status(udc, EP_DIR_IN, 0, true))
 			ep0_stall(udc);
drivers/usb/gadget/udc/net2272.c +1 -1
index 928057b206f1..fbbe62513545 100644
@@ -1688,7 +1688,7 @@ net2272_set_test_mode(struct net2272 *dev, int mode)
 	net2272_write(dev, USBTEST, mode);
 
 	/* load test packet */
-	if (mode == TEST_PACKET) {
+	if (mode == USB_TEST_PACKET) {
 		/* switch to 8 bit mode */
 		net2272_write(dev, LOCCTL, net2272_read(dev, LOCCTL) &
 				~(1 << DATA_WIDTH));
drivers/usb/gadget/udc/net2272.h +0 -5
index 8e644627992d..87d0ab9ffeeb 100644
@@ -105,11 +105,6 @@
 #define USBTEST				0x32
 #define 	TEST_MODE_SELECT			0
 #define 		NORMAL_OPERATION			0
-#define 		TEST_J					1
-#define 		TEST_K					2
-#define 		TEST_SE0_NAK				3
-#define 		TEST_PACKET				4
-#define 		TEST_FORCE_ENABLE			5
 #define XCVRDIAG			0x33
 #define 	FORCE_FULL_SPEED			2
 #define 	FORCE_HIGH_SPEED			3
drivers/usb/gadget/udc/udc-xilinx.c +2 -2
index 709553bdb233..d5e9d20c097d 100644
@@ -2097,9 +2097,9 @@ static int xudc_probe(struct platform_device *pdev)
 	/* Check for IP endianness */
 	udc->write_fn = xudc_write32_be;
 	udc->read_fn = xudc_read32_be;
-	udc->write_fn(udc->addr, XUSB_TESTMODE_OFFSET, TEST_J);
+	udc->write_fn(udc->addr, XUSB_TESTMODE_OFFSET, USB_TEST_J);
 	if ((udc->read_fn(udc->addr + XUSB_TESTMODE_OFFSET))
-			!= TEST_J) {
+			!= USB_TEST_J) {
 		udc->write_fn = xudc_write32;
 		udc->read_fn = xudc_read32;
 	}
drivers/usb/host/xhci-hub.c +4 -3
index f37316d2c8fa..073c54e42223 100644
@@ -612,7 +612,7 @@ static void xhci_port_set_test_mode(struct xhci_hcd *xhci,
 	temp |= test_mode << PORT_TEST_MODE_SHIFT;
 	writel(temp, port->addr + PORTPMSC);
 	xhci->test_mode = test_mode;
-	if (test_mode == TEST_FORCE_EN)
+	if (test_mode == USB_TEST_FORCE_ENABLE)
 		xhci_start(xhci);
 }
 
@@ -666,7 +666,7 @@ static int xhci_exit_test_mode(struct xhci_hcd *xhci)
 		xhci_err(xhci, "Not in test mode, do nothing.\n");
 		return 0;
 	}
-	if (xhci->test_mode == TEST_FORCE_EN &&
+	if (xhci->test_mode == USB_TEST_FORCE_ENABLE &&
 		!(xhci->xhc_state & XHCI_STATE_HALTED)) {
 		retval = xhci_halt(xhci);
 		if (retval)
@@ -1421,7 +1421,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 			/* 4.19.6 Port Test Modes (USB2 Test Mode) */
 			if (hcd->speed != HCD_USB2)
 				goto error;
-			if (test_mode > TEST_FORCE_EN || test_mode < TEST_J)
+			if (test_mode > USB_TEST_FORCE_ENABLE ||
+			    test_mode < USB_TEST_J)
 				goto error;
 			retval = xhci_enter_test_mode(xhci, test_mode, wIndex,
 						      &flags);
drivers/usb/misc/ehset.c +4 -4
index 7895d61e733b..2752e1f4f4d0 100644
@@ -33,28 +33,28 @@ static int ehset_probe(struct usb_interface *intf,
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_SE0_NAK << 8) | portnum,
+					(USB_TEST_SE0_NAK << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_J_PID:
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_J << 8) | portnum,
+					(USB_TEST_J << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_K_PID:
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_K << 8) | portnum,
+					(USB_TEST_K << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_PACKET_PID:
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_PACKET << 8) | portnum,
+					(USB_TEST_PACKET << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_HS_HOST_PORT_SUSPEND_RESUME:
drivers/usb/mtu3/mtu3_gadget_ep0.c +8 -8
index 2be182bd793a..563a0a2e970d 100644
@@ -278,20 +278,20 @@ static int handle_test_mode(struct mtu3 *mtu, struct usb_ctrlrequest *setup)
 	u32 value;
 
 	switch (le16_to_cpu(setup->wIndex) >> 8) {
-	case TEST_J:
-		dev_dbg(mtu->dev, "TEST_J\n");
+	case USB_TEST_J:
+		dev_dbg(mtu->dev, "USB_TEST_J\n");
 		mtu->test_mode_nr = TEST_J_MODE;
 		break;
-	case TEST_K:
-		dev_dbg(mtu->dev, "TEST_K\n");
+	case USB_TEST_K:
+		dev_dbg(mtu->dev, "USB_TEST_K\n");
 		mtu->test_mode_nr = TEST_K_MODE;
 		break;
-	case TEST_SE0_NAK:
-		dev_dbg(mtu->dev, "TEST_SE0_NAK\n");
+	case USB_TEST_SE0_NAK:
+		dev_dbg(mtu->dev, "USB_TEST_SE0_NAK\n");
 		mtu->test_mode_nr = TEST_SE0_NAK_MODE;
 		break;
-	case TEST_PACKET:
-		dev_dbg(mtu->dev, "TEST_PACKET\n");
+	case USB_TEST_PACKET:
+		dev_dbg(mtu->dev, "USB_TEST_PACKET\n");
 		mtu->test_mode_nr = TEST_PACKET_MODE;
 		break;
 	default:
drivers/usb/musb/musb_gadget_ep0.c +8 -12
index 91a5027b5c1f..0ae3e0be043e 100644
@@ -311,27 +311,23 @@ __acquires(musb->lock)
 						goto stall;
 
 					switch (ctrlrequest->wIndex >> 8) {
-					case 1:
-						pr_debug("TEST_J\n");
-						/* TEST_J */
+					case USB_TEST_J:
+						pr_debug("USB_TEST_J\n");
 						musb->test_mode_nr =
 							MUSB_TEST_J;
 						break;
-					case 2:
-						/* TEST_K */
-						pr_debug("TEST_K\n");
+					case USB_TEST_K:
+						pr_debug("USB_TEST_K\n");
 						musb->test_mode_nr =
 							MUSB_TEST_K;
 						break;
-					case 3:
-						/* TEST_SE0_NAK */
-						pr_debug("TEST_SE0_NAK\n");
+					case USB_TEST_SE0_NAK:
+						pr_debug("USB_TEST_SE0_NAK\n");
 						musb->test_mode_nr =
 							MUSB_TEST_SE0_NAK;
 						break;
-					case 4:
-						/* TEST_PACKET */
-						pr_debug("TEST_PACKET\n");
+					case USB_TEST_PACKET:
+						pr_debug("USB_TEST_PACKET\n");
 						musb->test_mode_nr =
 							MUSB_TEST_PACKET;
 						break;
drivers/usb/musb/musb_virthub.c +10 -10
index a84ec27c4c12..cb7ae297a3af 100644
@@ -385,25 +385,25 @@ int musb_hub_control(
 
 			wIndex >>= 8;
 			switch (wIndex) {
-			case 1:
-				pr_debug("TEST_J\n");
+			case USB_TEST_J:
+				pr_debug("USB_TEST_J\n");
 				temp = MUSB_TEST_J;
 				break;
-			case 2:
-				pr_debug("TEST_K\n");
+			case USB_TEST_K:
+				pr_debug("USB_TEST_K\n");
 				temp = MUSB_TEST_K;
 				break;
-			case 3:
-				pr_debug("TEST_SE0_NAK\n");
+			case USB_TEST_SE0_NAK:
+				pr_debug("USB_TEST_SE0_NAK\n");
 				temp = MUSB_TEST_SE0_NAK;
 				break;
-			case 4:
-				pr_debug("TEST_PACKET\n");
+			case USB_TEST_PACKET:
+				pr_debug("USB_TEST_PACKET\n");
 				temp = MUSB_TEST_PACKET;
 				musb_load_testpacket(musb);
 				break;
-			case 5:
-				pr_debug("TEST_FORCE_ENABLE\n");
+			case USB_TEST_FORCE_ENABLE:
+				pr_debug("USB_TEST_FORCE_ENABLE\n");
 				temp = MUSB_TEST_FORCE_HOST
 					| MUSB_TEST_FORCE_HS;
 
include/uapi/linux/usb/ch9.h +5 -5
index b1ed2ccfe9cf..48766fdf6580 100644
@@ -138,11 +138,11 @@
  * Test Mode Selectors
  * See USB 2.0 spec Table 9-7
  */
-#define	TEST_J		1
-#define	TEST_K		2
-#define	TEST_SE0_NAK	3
-#define	TEST_PACKET	4
-#define	TEST_FORCE_EN	5
+#define	USB_TEST_J		1
+#define	USB_TEST_K		2
+#define	USB_TEST_SE0_NAK	3
+#define	USB_TEST_PACKET		4
+#define	USB_TEST_FORCE_ENABLE	5
 
 /* Status Type */
 #define USB_STATUS_TYPE_STANDARD	0
Signature · 1 line
2.27.0
Signature · 2 lines
Thanks,
Peter Chen
Acked-by on v1 1/1
#2 lore raw
In reply to Greg Kroah-Hartman
Quoted 29 lines · Greg Kroah-Hartman

For some reason, the TEST_ defines in the usb/ch9.h files did not have the USB_ prefix on it, making it a bit confusing when reading the file, as well as not the nicest thing to do in a uapi file.

So fix that up and add the USB_ prefix on to them, and fix up all in-kernel usages. This included deleting the duplicate copy in the net2272.h file.

Cc Peter Chen <[email protected]>
Cc Minas Harutyunyan <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Michal Simek <[email protected]>
Cc Mathias Nyman <[email protected]>
Cc Chunfeng Yun <[email protected]>
Cc Bin Liu <[email protected]>
Cc Pawel Laszczak <[email protected]>
Cc YueHaibing <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Jason Yan <[email protected]>
Cc Jia-Ju Bai <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Christophe JAILLET <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Jules Irenge <[email protected]>
Cc Alan Stern <[email protected]>
Cc Thinh Nguyen <[email protected]>
Cc Rob Gill <[email protected]>
Cc Macpaul Lin <[email protected]>
Quoted 6 lines
---
  drivers/usb/cdns3/ep0.c              |  8 ++++----
  drivers/usb/chipidea/udc.c           | 10 +++++-----
  drivers/usb/common/debug.c           | 10 +++++-----
  drivers/usb/dwc2/debugfs.c           | 20 ++++++++++----------
  drivers/usb/dwc2/gadget.c            | 10 +++++-----

For dwc2:

Thanks,
Minas

Quoted 544 lines
  drivers/usb/dwc3/debugfs.c           | 20 ++++++++++----------
  drivers/usb/dwc3/ep0.c               | 10 +++++-----
  drivers/usb/dwc3/gadget.c            | 10 +++++-----
  drivers/usb/gadget/udc/bdc/bdc_ep.c  | 10 +++++-----
  drivers/usb/gadget/udc/gr_udc.c      |  4 ++--
  drivers/usb/gadget/udc/mv_udc_core.c |  2 +-
  drivers/usb/gadget/udc/net2272.c     |  2 +-
  drivers/usb/gadget/udc/net2272.h     |  5 -----
  drivers/usb/gadget/udc/udc-xilinx.c  |  4 ++--
  drivers/usb/host/xhci-hub.c          |  7 ++++---
  drivers/usb/misc/ehset.c             |  8 ++++----
  drivers/usb/mtu3/mtu3_gadget_ep0.c   | 16 ++++++++--------
  drivers/usb/musb/musb_gadget_ep0.c   | 20 ++++++++------------
  drivers/usb/musb/musb_virthub.c      | 20 ++++++++++----------
  include/uapi/linux/usb/ch9.h         | 10 +++++-----
  20 files changed, 99 insertions(+), 107 deletions(-)
drivers/usb/cdns3/ep0.c +4 -4
index 82645a2a0f52..04a522f5ae58 100644
@@ -328,10 +328,10 @@ static int cdns3_ep0_feature_handle_device(struct cdns3_device *priv_dev,
  			return -EINVAL;
 
  		switch (tmode >> 8) {
-		case TEST_J:
-		case TEST_K:
-		case TEST_SE0_NAK:
-		case TEST_PACKET:
+		case USB_TEST_J:
+		case USB_TEST_K:
+		case USB_TEST_SE0_NAK:
+		case USB_TEST_PACKET:
  			cdns3_set_register_bit(&priv_dev->regs->usb_cmd,
  					       USB_CMD_STMODE |
  					       USB_STS_TMODE_SEL(tmode - 1));
drivers/usb/chipidea/udc.c +5 -5
index db0cfde0cc3c..4beb25888917 100644
@@ -1215,11 +1215,11 @@ __acquires(ci->lock)
  			case USB_DEVICE_TEST_MODE:
  				tmode = le16_to_cpu(req.wIndex) >> 8;
  				switch (tmode) {
-				case TEST_J:
-				case TEST_K:
-				case TEST_SE0_NAK:
-				case TEST_PACKET:
-				case TEST_FORCE_EN:
+				case USB_TEST_J:
+				case USB_TEST_K:
+				case USB_TEST_SE0_NAK:
+				case USB_TEST_PACKET:
+				case USB_TEST_FORCE_ENABLE:
  					ci->test_mode = tmode;
  					err = isr_setup_status_phase(
  							ci);
drivers/usb/common/debug.c +5 -5
index 92a986aeaa5d..410acd670ca7 100644
@@ -53,15 +53,15 @@ static const char *usb_decode_device_feature(u16 wValue)
  static const char *usb_decode_test_mode(u16 wIndex)
  {
  	switch (wIndex) {
-	case TEST_J:
+	case USB_TEST_J:
  		return ": TEST_J";
-	case TEST_K:
+	case USB_TEST_K:
  		return ": TEST_K";
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
  		return ": TEST_SE0_NAK";
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
  		return ": TEST_PACKET";
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
  		return ": TEST_FORCE_EN";
  	default:
  		return ": UNKNOWN";
drivers/usb/dwc2/debugfs.c +10 -10
index 3a0dcbfbc827..aaafd463d72a 100644
@@ -37,15 +37,15 @@ static ssize_t testmode_write(struct file *file, const char __user *ubuf, size_t
  		return -EFAULT;
 
  	if (!strncmp(buf, "test_j", 6))
-		testmode = TEST_J;
+		testmode = USB_TEST_J;
  	else if (!strncmp(buf, "test_k", 6))
-		testmode = TEST_K;
+		testmode = USB_TEST_K;
  	else if (!strncmp(buf, "test_se0_nak", 12))
-		testmode = TEST_SE0_NAK;
+		testmode = USB_TEST_SE0_NAK;
  	else if (!strncmp(buf, "test_packet", 11))
-		testmode = TEST_PACKET;
+		testmode = USB_TEST_PACKET;
  	else if (!strncmp(buf, "test_force_enable", 17))
-		testmode = TEST_FORCE_EN;
+		testmode = USB_TEST_FORCE_ENABLE;
  	else
  		testmode = 0;
 
@@ -78,19 +78,19 @@ static int testmode_show(struct seq_file *s, void *unused)
  	case 0:
  		seq_puts(s, "no test\n");
  		break;
-	case TEST_J:
+	case USB_TEST_J:
  		seq_puts(s, "test_j\n");
  		break;
-	case TEST_K:
+	case USB_TEST_K:
  		seq_puts(s, "test_k\n");
  		break;
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
  		seq_puts(s, "test_se0_nak\n");
  		break;
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
  		seq_puts(s, "test_packet\n");
  		break;
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
  		seq_puts(s, "test_force_enable\n");
  		break;
  	default:
drivers/usb/dwc2/gadget.c +5 -5
index 12b98b466287..38fc46b0c026 100644
@@ -1561,11 +1561,11 @@ int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode)
 
  	dctl &= ~DCTL_TSTCTL_MASK;
  	switch (testmode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
  		dctl |= testmode << DCTL_TSTCTL_SHIFT;
  		break;
  	default:
drivers/usb/dwc3/debugfs.c +10 -10
index 6d9de334e46a..14dc6a37305d 100644
@@ -466,19 +466,19 @@ static int dwc3_testmode_show(struct seq_file *s, void *unused)
  	case 0:
  		seq_printf(s, "no test\n");
  		break;
-	case TEST_J:
+	case USB_TEST_J:
  		seq_printf(s, "test_j\n");
  		break;
-	case TEST_K:
+	case USB_TEST_K:
  		seq_printf(s, "test_k\n");
  		break;
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
  		seq_printf(s, "test_se0_nak\n");
  		break;
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
  		seq_printf(s, "test_packet\n");
  		break;
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
  		seq_printf(s, "test_force_enable\n");
  		break;
  	default:
@@ -506,15 +506,15 @@ static ssize_t dwc3_testmode_write(struct file *file,
  		return -EFAULT;
 
  	if (!strncmp(buf, "test_j", 6))
-		testmode = TEST_J;
+		testmode = USB_TEST_J;
  	else if (!strncmp(buf, "test_k", 6))
-		testmode = TEST_K;
+		testmode = USB_TEST_K;
  	else if (!strncmp(buf, "test_se0_nak", 12))
-		testmode = TEST_SE0_NAK;
+		testmode = USB_TEST_SE0_NAK;
  	else if (!strncmp(buf, "test_packet", 11))
-		testmode = TEST_PACKET;
+		testmode = USB_TEST_PACKET;
  	else if (!strncmp(buf, "test_force_enable", 17))
-		testmode = TEST_FORCE_EN;
+		testmode = USB_TEST_FORCE_ENABLE;
  	else
  		testmode = 0;
 
drivers/usb/dwc3/ep0.c +5 -5
index 6dee4dabc0a4..8dd69728add3 100644
@@ -425,11 +425,11 @@ static int dwc3_ep0_handle_test(struct dwc3 *dwc, enum usb_device_state state,
  		return -EINVAL;
 
  	switch (wIndex >> 8) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
  		dwc->test_mode_nr = wIndex >> 8;
  		dwc->test_mode = true;
  		break;
drivers/usb/dwc3/gadget.c +5 -5
index 80c3ef134e41..0b59b2f1cf26 100644
@@ -46,11 +46,11 @@ int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode)
  	reg &= ~DWC3_DCTL_TSTCTRL_MASK;
 
  	switch (mode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
  		reg |= mode << 1;
  		break;
  	default:
drivers/usb/gadget/udc/bdc/bdc_ep.c +5 -5
index d49c6dc1082d..ba250cf75bef 100644
@@ -927,11 +927,11 @@ static int bdc_set_test_mode(struct bdc *bdc)
  	usb2_pm &= ~BDC_PTC_MASK;
  	dev_dbg(bdc->dev, "%s\n", __func__);
  	switch (bdc->test_mode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
  		usb2_pm |= bdc->test_mode << 28;
  		break;
  	default:
drivers/usb/gadget/udc/gr_udc.c +2 -2
index 7164ad9800f1..345e28d76709 100644
@@ -912,9 +912,9 @@ static int gr_device_request(struct gr_udc *dev, u8 type, u8 request,
  			return gr_ep0_respond_empty(dev);
 
  		case USB_DEVICE_TEST_MODE:
-			/* The hardware does not support TEST_FORCE_EN */
+			/* The hardware does not support USB_TEST_FORCE_ENABLE */
  			test = index >> 8;
-			if (test >= TEST_J && test <= TEST_PACKET) {
+			if (test >= USB_TEST_J && test <= USB_TEST_PACKET) {
  				dev->test_mode = test;
  				return gr_ep0_respond(dev, NULL, 0,
  						      gr_ep0_testmode_complete);
drivers/usb/gadget/udc/mv_udc_core.c +1 -1
index cafde053788b..69289717d856 100644
@@ -1502,7 +1502,7 @@ udc_prime_status(struct mv_udc *udc, u8 direction, u16 status, bool empty)
 
  static void mv_udc_testmode(struct mv_udc *udc, u16 index)
  {
-	if (index <= TEST_FORCE_EN) {
+	if (index <= USB_TEST_FORCE_ENABLE) {
  		udc->test_mode = index;
  		if (udc_prime_status(udc, EP_DIR_IN, 0, true))
  			ep0_stall(udc);
drivers/usb/gadget/udc/net2272.c +1 -1
index 928057b206f1..fbbe62513545 100644
@@ -1688,7 +1688,7 @@ net2272_set_test_mode(struct net2272 *dev, int mode)
  	net2272_write(dev, USBTEST, mode);
 
  	/* load test packet */
-	if (mode == TEST_PACKET) {
+	if (mode == USB_TEST_PACKET) {
  		/* switch to 8 bit mode */
  		net2272_write(dev, LOCCTL, net2272_read(dev, LOCCTL) &
  				~(1 << DATA_WIDTH));
drivers/usb/gadget/udc/net2272.h +0 -5
index 8e644627992d..87d0ab9ffeeb 100644
@@ -105,11 +105,6 @@
  #define USBTEST				0x32
  #define 	TEST_MODE_SELECT			0
  #define 		NORMAL_OPERATION			0
-#define 		TEST_J					1
-#define 		TEST_K					2
-#define 		TEST_SE0_NAK				3
-#define 		TEST_PACKET				4
-#define 		TEST_FORCE_ENABLE			5
  #define XCVRDIAG			0x33
  #define 	FORCE_FULL_SPEED			2
  #define 	FORCE_HIGH_SPEED			3
drivers/usb/gadget/udc/udc-xilinx.c +2 -2
index 709553bdb233..d5e9d20c097d 100644
@@ -2097,9 +2097,9 @@ static int xudc_probe(struct platform_device *pdev)
  	/* Check for IP endianness */
  	udc->write_fn = xudc_write32_be;
  	udc->read_fn = xudc_read32_be;
-	udc->write_fn(udc->addr, XUSB_TESTMODE_OFFSET, TEST_J);
+	udc->write_fn(udc->addr, XUSB_TESTMODE_OFFSET, USB_TEST_J);
  	if ((udc->read_fn(udc->addr + XUSB_TESTMODE_OFFSET))
-			!= TEST_J) {
+			!= USB_TEST_J) {
  		udc->write_fn = xudc_write32;
  		udc->read_fn = xudc_read32;
  	}
drivers/usb/host/xhci-hub.c +4 -3
index f37316d2c8fa..073c54e42223 100644
@@ -612,7 +612,7 @@ static void xhci_port_set_test_mode(struct xhci_hcd *xhci,
  	temp |= test_mode << PORT_TEST_MODE_SHIFT;
  	writel(temp, port->addr + PORTPMSC);
  	xhci->test_mode = test_mode;
-	if (test_mode == TEST_FORCE_EN)
+	if (test_mode == USB_TEST_FORCE_ENABLE)
  		xhci_start(xhci);
  }
 
@@ -666,7 +666,7 @@ static int xhci_exit_test_mode(struct xhci_hcd *xhci)
  		xhci_err(xhci, "Not in test mode, do nothing.\n");
  		return 0;
  	}
-	if (xhci->test_mode == TEST_FORCE_EN &&
+	if (xhci->test_mode == USB_TEST_FORCE_ENABLE &&
  		!(xhci->xhc_state & XHCI_STATE_HALTED)) {
  		retval = xhci_halt(xhci);
  		if (retval)
@@ -1421,7 +1421,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
  			/* 4.19.6 Port Test Modes (USB2 Test Mode) */
  			if (hcd->speed != HCD_USB2)
  				goto error;
-			if (test_mode > TEST_FORCE_EN || test_mode < TEST_J)
+			if (test_mode > USB_TEST_FORCE_ENABLE ||
+			    test_mode < USB_TEST_J)
  				goto error;
  			retval = xhci_enter_test_mode(xhci, test_mode, wIndex,
  						      &flags);
drivers/usb/misc/ehset.c +4 -4
index 7895d61e733b..2752e1f4f4d0 100644
@@ -33,28 +33,28 @@ static int ehset_probe(struct usb_interface *intf,
  		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
  					USB_REQ_SET_FEATURE, USB_RT_PORT,
  					USB_PORT_FEAT_TEST,
-					(TEST_SE0_NAK << 8) | portnum,
+					(USB_TEST_SE0_NAK << 8) | portnum,
  					NULL, 0, 1000);
  		break;
  	case TEST_J_PID:
  		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
  					USB_REQ_SET_FEATURE, USB_RT_PORT,
  					USB_PORT_FEAT_TEST,
-					(TEST_J << 8) | portnum,
+					(USB_TEST_J << 8) | portnum,
  					NULL, 0, 1000);
  		break;
  	case TEST_K_PID:
  		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
  					USB_REQ_SET_FEATURE, USB_RT_PORT,
  					USB_PORT_FEAT_TEST,
-					(TEST_K << 8) | portnum,
+					(USB_TEST_K << 8) | portnum,
  					NULL, 0, 1000);
  		break;
  	case TEST_PACKET_PID:
  		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
  					USB_REQ_SET_FEATURE, USB_RT_PORT,
  					USB_PORT_FEAT_TEST,
-					(TEST_PACKET << 8) | portnum,
+					(USB_TEST_PACKET << 8) | portnum,
  					NULL, 0, 1000);
  		break;
  	case TEST_HS_HOST_PORT_SUSPEND_RESUME:
drivers/usb/mtu3/mtu3_gadget_ep0.c +8 -8
index 2be182bd793a..563a0a2e970d 100644
@@ -278,20 +278,20 @@ static int handle_test_mode(struct mtu3 *mtu, struct usb_ctrlrequest *setup)
  	u32 value;
 
  	switch (le16_to_cpu(setup->wIndex) >> 8) {
-	case TEST_J:
-		dev_dbg(mtu->dev, "TEST_J\n");
+	case USB_TEST_J:
+		dev_dbg(mtu->dev, "USB_TEST_J\n");
  		mtu->test_mode_nr = TEST_J_MODE;
  		break;
-	case TEST_K:
-		dev_dbg(mtu->dev, "TEST_K\n");
+	case USB_TEST_K:
+		dev_dbg(mtu->dev, "USB_TEST_K\n");
  		mtu->test_mode_nr = TEST_K_MODE;
  		break;
-	case TEST_SE0_NAK:
-		dev_dbg(mtu->dev, "TEST_SE0_NAK\n");
+	case USB_TEST_SE0_NAK:
+		dev_dbg(mtu->dev, "USB_TEST_SE0_NAK\n");
  		mtu->test_mode_nr = TEST_SE0_NAK_MODE;
  		break;
-	case TEST_PACKET:
-		dev_dbg(mtu->dev, "TEST_PACKET\n");
+	case USB_TEST_PACKET:
+		dev_dbg(mtu->dev, "USB_TEST_PACKET\n");
  		mtu->test_mode_nr = TEST_PACKET_MODE;
  		break;
  	default:
drivers/usb/musb/musb_gadget_ep0.c +8 -12
index 91a5027b5c1f..0ae3e0be043e 100644
@@ -311,27 +311,23 @@ __acquires(musb->lock)
  						goto stall;
 
  					switch (ctrlrequest->wIndex >> 8) {
-					case 1:
-						pr_debug("TEST_J\n");
-						/* TEST_J */
+					case USB_TEST_J:
+						pr_debug("USB_TEST_J\n");
  						musb->test_mode_nr =
  							MUSB_TEST_J;
  						break;
-					case 2:
-						/* TEST_K */
-						pr_debug("TEST_K\n");
+					case USB_TEST_K:
+						pr_debug("USB_TEST_K\n");
  						musb->test_mode_nr =
  							MUSB_TEST_K;
  						break;
-					case 3:
-						/* TEST_SE0_NAK */
-						pr_debug("TEST_SE0_NAK\n");
+					case USB_TEST_SE0_NAK:
+						pr_debug("USB_TEST_SE0_NAK\n");
  						musb->test_mode_nr =
  							MUSB_TEST_SE0_NAK;
  						break;
-					case 4:
-						/* TEST_PACKET */
-						pr_debug("TEST_PACKET\n");
+					case USB_TEST_PACKET:
+						pr_debug("USB_TEST_PACKET\n");
  						musb->test_mode_nr =
  							MUSB_TEST_PACKET;
  						break;
drivers/usb/musb/musb_virthub.c +10 -10
index a84ec27c4c12..cb7ae297a3af 100644
@@ -385,25 +385,25 @@ int musb_hub_control(
 
  			wIndex >>= 8;
  			switch (wIndex) {
-			case 1:
-				pr_debug("TEST_J\n");
+			case USB_TEST_J:
+				pr_debug("USB_TEST_J\n");
  				temp = MUSB_TEST_J;
  				break;
-			case 2:
-				pr_debug("TEST_K\n");
+			case USB_TEST_K:
+				pr_debug("USB_TEST_K\n");
  				temp = MUSB_TEST_K;
  				break;
-			case 3:
-				pr_debug("TEST_SE0_NAK\n");
+			case USB_TEST_SE0_NAK:
+				pr_debug("USB_TEST_SE0_NAK\n");
  				temp = MUSB_TEST_SE0_NAK;
  				break;
-			case 4:
-				pr_debug("TEST_PACKET\n");
+			case USB_TEST_PACKET:
+				pr_debug("USB_TEST_PACKET\n");
  				temp = MUSB_TEST_PACKET;
  				musb_load_testpacket(musb);
  				break;
-			case 5:
-				pr_debug("TEST_FORCE_ENABLE\n");
+			case USB_TEST_FORCE_ENABLE:
+				pr_debug("USB_TEST_FORCE_ENABLE\n");
  				temp = MUSB_TEST_FORCE_HOST
  					| MUSB_TEST_FORCE_HS;
 
include/uapi/linux/usb/ch9.h +5 -5
index b1ed2ccfe9cf..48766fdf6580 100644
@@ -138,11 +138,11 @@
   * Test Mode Selectors
   * See USB 2.0 spec Table 9-7
   */
-#define	TEST_J		1
-#define	TEST_K		2
-#define	TEST_SE0_NAK	3
-#define	TEST_PACKET	4
-#define	TEST_FORCE_EN	5
+#define	USB_TEST_J		1
+#define	USB_TEST_K		2
+#define	USB_TEST_SE0_NAK	3
+#define	USB_TEST_PACKET		4
+#define	USB_TEST_FORCE_ENABLE	5
 
  /* Status Type */
  #define USB_STATUS_TYPE_STANDARD	0
maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Greg Kroah-Hartman
Quoted 41 lines · Greg Kroah-Hartman

For some reason, the TEST_ defines in the usb/ch9.h files did not have the USB_ prefix on it, making it a bit confusing when reading the file, as well as not the nicest thing to do in a uapi file.

So fix that up and add the USB_ prefix on to them, and fix up all in-kernel usages. This included deleting the duplicate copy in the net2272.h file.

Cc Peter Chen <[email protected]>
Cc Minas Harutyunyan <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Michal Simek <[email protected]>
Cc Mathias Nyman <[email protected]>
Cc Chunfeng Yun <[email protected]>
Cc Bin Liu <[email protected]>
Cc Pawel Laszczak <[email protected]>
Cc YueHaibing <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Jason Yan <[email protected]>
Cc Jia-Ju Bai <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Christophe JAILLET <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Jules Irenge <[email protected]>
Cc Alan Stern <[email protected]>
Cc Thinh Nguyen <[email protected]>
Cc Rob Gill <[email protected]>
Cc Macpaul Lin <[email protected]>
---
 drivers/usb/cdns3/ep0.c              |  8 ++++----
 drivers/usb/chipidea/udc.c           | 10 +++++-----
 drivers/usb/common/debug.c           | 10 +++++-----
 drivers/usb/dwc2/debugfs.c           | 20 ++++++++++----------
 drivers/usb/dwc2/gadget.c            | 10 +++++-----
 drivers/usb/dwc3/debugfs.c           | 20 ++++++++++----------
 drivers/usb/dwc3/ep0.c               | 10 +++++-----
 drivers/usb/dwc3/gadget.c            | 10 +++++-----
 drivers/usb/gadget/udc/bdc/bdc_ep.c  | 10 +++++-----
 drivers/usb/gadget/udc/gr_udc.c      |  4 ++--
 drivers/usb/gadget/udc/mv_udc_core.c |  2 +-
Quoted 8 lines
 drivers/usb/gadget/udc/net2272.c     |  2 +-
 drivers/usb/gadget/udc/net2272.h     |  5 -----
 drivers/usb/gadget/udc/udc-xilinx.c  |  4 ++--
 drivers/usb/host/xhci-hub.c          |  7 ++++---
 drivers/usb/misc/ehset.c             |  8 ++++----
 drivers/usb/mtu3/mtu3_gadget_ep0.c   | 16 ++++++++--------
 drivers/usb/musb/musb_gadget_ep0.c   | 20 ++++++++------------
 drivers/usb/musb/musb_virthub.c      | 20 ++++++++++----------

For musb:

Thanks,
-Bin.

Quoted 532 lines
 include/uapi/linux/usb/ch9.h         | 10 +++++-----
 20 files changed, 99 insertions(+), 107 deletions(-)
drivers/usb/cdns3/ep0.c +4 -4
index 82645a2a0f52..04a522f5ae58 100644
@@ -328,10 +328,10 @@ static int cdns3_ep0_feature_handle_device(struct cdns3_device *priv_dev,
 			return -EINVAL;
 
 		switch (tmode >> 8) {
-		case TEST_J:
-		case TEST_K:
-		case TEST_SE0_NAK:
-		case TEST_PACKET:
+		case USB_TEST_J:
+		case USB_TEST_K:
+		case USB_TEST_SE0_NAK:
+		case USB_TEST_PACKET:
 			cdns3_set_register_bit(&priv_dev->regs->usb_cmd,
 					       USB_CMD_STMODE |
 					       USB_STS_TMODE_SEL(tmode - 1));
drivers/usb/chipidea/udc.c +5 -5
index db0cfde0cc3c..4beb25888917 100644
@@ -1215,11 +1215,11 @@ __acquires(ci->lock)
 			case USB_DEVICE_TEST_MODE:
 				tmode = le16_to_cpu(req.wIndex) >> 8;
 				switch (tmode) {
-				case TEST_J:
-				case TEST_K:
-				case TEST_SE0_NAK:
-				case TEST_PACKET:
-				case TEST_FORCE_EN:
+				case USB_TEST_J:
+				case USB_TEST_K:
+				case USB_TEST_SE0_NAK:
+				case USB_TEST_PACKET:
+				case USB_TEST_FORCE_ENABLE:
 					ci->test_mode = tmode;
 					err = isr_setup_status_phase(
 							ci);
drivers/usb/common/debug.c +5 -5
index 92a986aeaa5d..410acd670ca7 100644
@@ -53,15 +53,15 @@ static const char *usb_decode_device_feature(u16 wValue)
 static const char *usb_decode_test_mode(u16 wIndex)
 {
 	switch (wIndex) {
-	case TEST_J:
+	case USB_TEST_J:
 		return ": TEST_J";
-	case TEST_K:
+	case USB_TEST_K:
 		return ": TEST_K";
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
 		return ": TEST_SE0_NAK";
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
 		return ": TEST_PACKET";
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
 		return ": TEST_FORCE_EN";
 	default:
 		return ": UNKNOWN";
drivers/usb/dwc2/debugfs.c +10 -10
index 3a0dcbfbc827..aaafd463d72a 100644
@@ -37,15 +37,15 @@ static ssize_t testmode_write(struct file *file, const char __user *ubuf, size_t
 		return -EFAULT;
 
 	if (!strncmp(buf, "test_j", 6))
-		testmode = TEST_J;
+		testmode = USB_TEST_J;
 	else if (!strncmp(buf, "test_k", 6))
-		testmode = TEST_K;
+		testmode = USB_TEST_K;
 	else if (!strncmp(buf, "test_se0_nak", 12))
-		testmode = TEST_SE0_NAK;
+		testmode = USB_TEST_SE0_NAK;
 	else if (!strncmp(buf, "test_packet", 11))
-		testmode = TEST_PACKET;
+		testmode = USB_TEST_PACKET;
 	else if (!strncmp(buf, "test_force_enable", 17))
-		testmode = TEST_FORCE_EN;
+		testmode = USB_TEST_FORCE_ENABLE;
 	else
 		testmode = 0;
 
@@ -78,19 +78,19 @@ static int testmode_show(struct seq_file *s, void *unused)
 	case 0:
 		seq_puts(s, "no test\n");
 		break;
-	case TEST_J:
+	case USB_TEST_J:
 		seq_puts(s, "test_j\n");
 		break;
-	case TEST_K:
+	case USB_TEST_K:
 		seq_puts(s, "test_k\n");
 		break;
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
 		seq_puts(s, "test_se0_nak\n");
 		break;
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
 		seq_puts(s, "test_packet\n");
 		break;
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
 		seq_puts(s, "test_force_enable\n");
 		break;
 	default:
drivers/usb/dwc2/gadget.c +5 -5
index 12b98b466287..38fc46b0c026 100644
@@ -1561,11 +1561,11 @@ int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode)
 
 	dctl &= ~DCTL_TSTCTL_MASK;
 	switch (testmode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		dctl |= testmode << DCTL_TSTCTL_SHIFT;
 		break;
 	default:
drivers/usb/dwc3/debugfs.c +10 -10
index 6d9de334e46a..14dc6a37305d 100644
@@ -466,19 +466,19 @@ static int dwc3_testmode_show(struct seq_file *s, void *unused)
 	case 0:
 		seq_printf(s, "no test\n");
 		break;
-	case TEST_J:
+	case USB_TEST_J:
 		seq_printf(s, "test_j\n");
 		break;
-	case TEST_K:
+	case USB_TEST_K:
 		seq_printf(s, "test_k\n");
 		break;
-	case TEST_SE0_NAK:
+	case USB_TEST_SE0_NAK:
 		seq_printf(s, "test_se0_nak\n");
 		break;
-	case TEST_PACKET:
+	case USB_TEST_PACKET:
 		seq_printf(s, "test_packet\n");
 		break;
-	case TEST_FORCE_EN:
+	case USB_TEST_FORCE_ENABLE:
 		seq_printf(s, "test_force_enable\n");
 		break;
 	default:
@@ -506,15 +506,15 @@ static ssize_t dwc3_testmode_write(struct file *file,
 		return -EFAULT;
 
 	if (!strncmp(buf, "test_j", 6))
-		testmode = TEST_J;
+		testmode = USB_TEST_J;
 	else if (!strncmp(buf, "test_k", 6))
-		testmode = TEST_K;
+		testmode = USB_TEST_K;
 	else if (!strncmp(buf, "test_se0_nak", 12))
-		testmode = TEST_SE0_NAK;
+		testmode = USB_TEST_SE0_NAK;
 	else if (!strncmp(buf, "test_packet", 11))
-		testmode = TEST_PACKET;
+		testmode = USB_TEST_PACKET;
 	else if (!strncmp(buf, "test_force_enable", 17))
-		testmode = TEST_FORCE_EN;
+		testmode = USB_TEST_FORCE_ENABLE;
 	else
 		testmode = 0;
 
drivers/usb/dwc3/ep0.c +5 -5
index 6dee4dabc0a4..8dd69728add3 100644
@@ -425,11 +425,11 @@ static int dwc3_ep0_handle_test(struct dwc3 *dwc, enum usb_device_state state,
 		return -EINVAL;
 
 	switch (wIndex >> 8) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		dwc->test_mode_nr = wIndex >> 8;
 		dwc->test_mode = true;
 		break;
drivers/usb/dwc3/gadget.c +5 -5
index 80c3ef134e41..0b59b2f1cf26 100644
@@ -46,11 +46,11 @@ int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode)
 	reg &= ~DWC3_DCTL_TSTCTRL_MASK;
 
 	switch (mode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		reg |= mode << 1;
 		break;
 	default:
drivers/usb/gadget/udc/bdc/bdc_ep.c +5 -5
index d49c6dc1082d..ba250cf75bef 100644
@@ -927,11 +927,11 @@ static int bdc_set_test_mode(struct bdc *bdc)
 	usb2_pm &= ~BDC_PTC_MASK;
 	dev_dbg(bdc->dev, "%s\n", __func__);
 	switch (bdc->test_mode) {
-	case TEST_J:
-	case TEST_K:
-	case TEST_SE0_NAK:
-	case TEST_PACKET:
-	case TEST_FORCE_EN:
+	case USB_TEST_J:
+	case USB_TEST_K:
+	case USB_TEST_SE0_NAK:
+	case USB_TEST_PACKET:
+	case USB_TEST_FORCE_ENABLE:
 		usb2_pm |= bdc->test_mode << 28;
 		break;
 	default:
drivers/usb/gadget/udc/gr_udc.c +2 -2
index 7164ad9800f1..345e28d76709 100644
@@ -912,9 +912,9 @@ static int gr_device_request(struct gr_udc *dev, u8 type, u8 request,
 			return gr_ep0_respond_empty(dev);
 
 		case USB_DEVICE_TEST_MODE:
-			/* The hardware does not support TEST_FORCE_EN */
+			/* The hardware does not support USB_TEST_FORCE_ENABLE */
 			test = index >> 8;
-			if (test >= TEST_J && test <= TEST_PACKET) {
+			if (test >= USB_TEST_J && test <= USB_TEST_PACKET) {
 				dev->test_mode = test;
 				return gr_ep0_respond(dev, NULL, 0,
 						      gr_ep0_testmode_complete);
drivers/usb/gadget/udc/mv_udc_core.c +1 -1
index cafde053788b..69289717d856 100644
@@ -1502,7 +1502,7 @@ udc_prime_status(struct mv_udc *udc, u8 direction, u16 status, bool empty)
 
 static void mv_udc_testmode(struct mv_udc *udc, u16 index)
 {
-	if (index <= TEST_FORCE_EN) {
+	if (index <= USB_TEST_FORCE_ENABLE) {
 		udc->test_mode = index;
 		if (udc_prime_status(udc, EP_DIR_IN, 0, true))
 			ep0_stall(udc);
drivers/usb/gadget/udc/net2272.c +1 -1
index 928057b206f1..fbbe62513545 100644
@@ -1688,7 +1688,7 @@ net2272_set_test_mode(struct net2272 *dev, int mode)
 	net2272_write(dev, USBTEST, mode);
 
 	/* load test packet */
-	if (mode == TEST_PACKET) {
+	if (mode == USB_TEST_PACKET) {
 		/* switch to 8 bit mode */
 		net2272_write(dev, LOCCTL, net2272_read(dev, LOCCTL) &
 				~(1 << DATA_WIDTH));
drivers/usb/gadget/udc/net2272.h +0 -5
index 8e644627992d..87d0ab9ffeeb 100644
@@ -105,11 +105,6 @@
 #define USBTEST				0x32
 #define 	TEST_MODE_SELECT			0
 #define 		NORMAL_OPERATION			0
-#define 		TEST_J					1
-#define 		TEST_K					2
-#define 		TEST_SE0_NAK				3
-#define 		TEST_PACKET				4
-#define 		TEST_FORCE_ENABLE			5
 #define XCVRDIAG			0x33
 #define 	FORCE_FULL_SPEED			2
 #define 	FORCE_HIGH_SPEED			3
drivers/usb/gadget/udc/udc-xilinx.c +2 -2
index 709553bdb233..d5e9d20c097d 100644
@@ -2097,9 +2097,9 @@ static int xudc_probe(struct platform_device *pdev)
 	/* Check for IP endianness */
 	udc->write_fn = xudc_write32_be;
 	udc->read_fn = xudc_read32_be;
-	udc->write_fn(udc->addr, XUSB_TESTMODE_OFFSET, TEST_J);
+	udc->write_fn(udc->addr, XUSB_TESTMODE_OFFSET, USB_TEST_J);
 	if ((udc->read_fn(udc->addr + XUSB_TESTMODE_OFFSET))
-			!= TEST_J) {
+			!= USB_TEST_J) {
 		udc->write_fn = xudc_write32;
 		udc->read_fn = xudc_read32;
 	}
drivers/usb/host/xhci-hub.c +4 -3
index f37316d2c8fa..073c54e42223 100644
@@ -612,7 +612,7 @@ static void xhci_port_set_test_mode(struct xhci_hcd *xhci,
 	temp |= test_mode << PORT_TEST_MODE_SHIFT;
 	writel(temp, port->addr + PORTPMSC);
 	xhci->test_mode = test_mode;
-	if (test_mode == TEST_FORCE_EN)
+	if (test_mode == USB_TEST_FORCE_ENABLE)
 		xhci_start(xhci);
 }
 
@@ -666,7 +666,7 @@ static int xhci_exit_test_mode(struct xhci_hcd *xhci)
 		xhci_err(xhci, "Not in test mode, do nothing.\n");
 		return 0;
 	}
-	if (xhci->test_mode == TEST_FORCE_EN &&
+	if (xhci->test_mode == USB_TEST_FORCE_ENABLE &&
 		!(xhci->xhc_state & XHCI_STATE_HALTED)) {
 		retval = xhci_halt(xhci);
 		if (retval)
@@ -1421,7 +1421,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 			/* 4.19.6 Port Test Modes (USB2 Test Mode) */
 			if (hcd->speed != HCD_USB2)
 				goto error;
-			if (test_mode > TEST_FORCE_EN || test_mode < TEST_J)
+			if (test_mode > USB_TEST_FORCE_ENABLE ||
+			    test_mode < USB_TEST_J)
 				goto error;
 			retval = xhci_enter_test_mode(xhci, test_mode, wIndex,
 						      &flags);
drivers/usb/misc/ehset.c +4 -4
index 7895d61e733b..2752e1f4f4d0 100644
@@ -33,28 +33,28 @@ static int ehset_probe(struct usb_interface *intf,
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_SE0_NAK << 8) | portnum,
+					(USB_TEST_SE0_NAK << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_J_PID:
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_J << 8) | portnum,
+					(USB_TEST_J << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_K_PID:
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_K << 8) | portnum,
+					(USB_TEST_K << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_PACKET_PID:
 		ret = usb_control_msg(hub_udev, usb_sndctrlpipe(hub_udev, 0),
 					USB_REQ_SET_FEATURE, USB_RT_PORT,
 					USB_PORT_FEAT_TEST,
-					(TEST_PACKET << 8) | portnum,
+					(USB_TEST_PACKET << 8) | portnum,
 					NULL, 0, 1000);
 		break;
 	case TEST_HS_HOST_PORT_SUSPEND_RESUME:
drivers/usb/mtu3/mtu3_gadget_ep0.c +8 -8
index 2be182bd793a..563a0a2e970d 100644
@@ -278,20 +278,20 @@ static int handle_test_mode(struct mtu3 *mtu, struct usb_ctrlrequest *setup)
 	u32 value;
 
 	switch (le16_to_cpu(setup->wIndex) >> 8) {
-	case TEST_J:
-		dev_dbg(mtu->dev, "TEST_J\n");
+	case USB_TEST_J:
+		dev_dbg(mtu->dev, "USB_TEST_J\n");
 		mtu->test_mode_nr = TEST_J_MODE;
 		break;
-	case TEST_K:
-		dev_dbg(mtu->dev, "TEST_K\n");
+	case USB_TEST_K:
+		dev_dbg(mtu->dev, "USB_TEST_K\n");
 		mtu->test_mode_nr = TEST_K_MODE;
 		break;
-	case TEST_SE0_NAK:
-		dev_dbg(mtu->dev, "TEST_SE0_NAK\n");
+	case USB_TEST_SE0_NAK:
+		dev_dbg(mtu->dev, "USB_TEST_SE0_NAK\n");
 		mtu->test_mode_nr = TEST_SE0_NAK_MODE;
 		break;
-	case TEST_PACKET:
-		dev_dbg(mtu->dev, "TEST_PACKET\n");
+	case USB_TEST_PACKET:
+		dev_dbg(mtu->dev, "USB_TEST_PACKET\n");
 		mtu->test_mode_nr = TEST_PACKET_MODE;
 		break;
 	default:
drivers/usb/musb/musb_gadget_ep0.c +8 -12
index 91a5027b5c1f..0ae3e0be043e 100644
@@ -311,27 +311,23 @@ __acquires(musb->lock)
 						goto stall;
 
 					switch (ctrlrequest->wIndex >> 8) {
-					case 1:
-						pr_debug("TEST_J\n");
-						/* TEST_J */
+					case USB_TEST_J:
+						pr_debug("USB_TEST_J\n");
 						musb->test_mode_nr =
 							MUSB_TEST_J;
 						break;
-					case 2:
-						/* TEST_K */
-						pr_debug("TEST_K\n");
+					case USB_TEST_K:
+						pr_debug("USB_TEST_K\n");
 						musb->test_mode_nr =
 							MUSB_TEST_K;
 						break;
-					case 3:
-						/* TEST_SE0_NAK */
-						pr_debug("TEST_SE0_NAK\n");
+					case USB_TEST_SE0_NAK:
+						pr_debug("USB_TEST_SE0_NAK\n");
 						musb->test_mode_nr =
 							MUSB_TEST_SE0_NAK;
 						break;
-					case 4:
-						/* TEST_PACKET */
-						pr_debug("TEST_PACKET\n");
+					case USB_TEST_PACKET:
+						pr_debug("USB_TEST_PACKET\n");
 						musb->test_mode_nr =
 							MUSB_TEST_PACKET;
 						break;
drivers/usb/musb/musb_virthub.c +10 -10
index a84ec27c4c12..cb7ae297a3af 100644
@@ -385,25 +385,25 @@ int musb_hub_control(
 
 			wIndex >>= 8;
 			switch (wIndex) {
-			case 1:
-				pr_debug("TEST_J\n");
+			case USB_TEST_J:
+				pr_debug("USB_TEST_J\n");
 				temp = MUSB_TEST_J;
 				break;
-			case 2:
-				pr_debug("TEST_K\n");
+			case USB_TEST_K:
+				pr_debug("USB_TEST_K\n");
 				temp = MUSB_TEST_K;
 				break;
-			case 3:
-				pr_debug("TEST_SE0_NAK\n");
+			case USB_TEST_SE0_NAK:
+				pr_debug("USB_TEST_SE0_NAK\n");
 				temp = MUSB_TEST_SE0_NAK;
 				break;
-			case 4:
-				pr_debug("TEST_PACKET\n");
+			case USB_TEST_PACKET:
+				pr_debug("USB_TEST_PACKET\n");
 				temp = MUSB_TEST_PACKET;
 				musb_load_testpacket(musb);
 				break;
-			case 5:
-				pr_debug("TEST_FORCE_ENABLE\n");
+			case USB_TEST_FORCE_ENABLE:
+				pr_debug("USB_TEST_FORCE_ENABLE\n");
 				temp = MUSB_TEST_FORCE_HOST
 					| MUSB_TEST_FORCE_HS;
 
include/uapi/linux/usb/ch9.h +5 -5
index b1ed2ccfe9cf..48766fdf6580 100644
@@ -138,11 +138,11 @@
  * Test Mode Selectors
  * See USB 2.0 spec Table 9-7
  */
-#define	TEST_J		1
-#define	TEST_K		2
-#define	TEST_SE0_NAK	3
-#define	TEST_PACKET	4
-#define	TEST_FORCE_EN	5
+#define	USB_TEST_J		1
+#define	USB_TEST_K		2
+#define	USB_TEST_SE0_NAK	3
+#define	USB_TEST_PACKET		4
+#define	USB_TEST_FORCE_ENABLE	5
 
 /* Status Type */
 #define USB_STATUS_TYPE_STANDARD	0
Signature · 1 line
2.27.0
maintainer Acked-by on v1 1/1
#4 lore raw
In reply to Greg Kroah-Hartman
Quoted 39 lines · Greg Kroah-Hartman

For some reason, the TEST_ defines in the usb/ch9.h files did not have the USB_ prefix on it, making it a bit confusing when reading the file, as well as not the nicest thing to do in a uapi file.

So fix that up and add the USB_ prefix on to them, and fix up all in-kernel usages. This included deleting the duplicate copy in the net2272.h file.

Cc Peter Chen <[email protected]>
Cc Minas Harutyunyan <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Michal Simek <[email protected]>
Cc Mathias Nyman <[email protected]>
Cc Chunfeng Yun <[email protected]>
Cc Bin Liu <[email protected]>
Cc Pawel Laszczak <[email protected]>
Cc YueHaibing <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Jason Yan <[email protected]>
Cc Jia-Ju Bai <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Christophe JAILLET <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Jules Irenge <[email protected]>
Cc Alan Stern <[email protected]>
Cc Thinh Nguyen <[email protected]>
Cc Rob Gill <[email protected]>
Cc Macpaul Lin <[email protected]>
---
 drivers/usb/cdns3/ep0.c              |  8 ++++----
 drivers/usb/chipidea/udc.c           | 10 +++++-----
 drivers/usb/common/debug.c           | 10 +++++-----
 drivers/usb/dwc2/debugfs.c           | 20 ++++++++++----------
 drivers/usb/dwc2/gadget.c            | 10 +++++-----
 drivers/usb/dwc3/debugfs.c           | 20 ++++++++++----------
 drivers/usb/dwc3/ep0.c               | 10 +++++-----
 drivers/usb/dwc3/gadget.c            | 10 +++++-----
 drivers/usb/gadget/udc/bdc/bdc_ep.c  | 10 +++++-----
Quoted 8 lines
 drivers/usb/gadget/udc/gr_udc.c      |  4 ++--
 drivers/usb/gadget/udc/mv_udc_core.c |  2 +-
 drivers/usb/gadget/udc/net2272.c     |  2 +-
 drivers/usb/gadget/udc/net2272.h     |  5 -----
 drivers/usb/gadget/udc/udc-xilinx.c  |  4 ++--
 drivers/usb/host/xhci-hub.c          |  7 ++++---
 drivers/usb/misc/ehset.c             |  8 ++++----
 drivers/usb/mtu3/mtu3_gadget_ep0.c   | 16 ++++++++--------

for mtu3,

Thanks

Quoted 4 lines
 drivers/usb/musb/musb_gadget_ep0.c   | 20 ++++++++------------
 drivers/usb/musb/musb_virthub.c      | 20 ++++++++++----------
 include/uapi/linux/usb/ch9.h         | 10 +++++-----
 20 files changed, 99 insertions(+), 107 deletions(-)