[PATCH 1/2] usb: dwc3: debugfs: fix off by one when entering testmode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Gerard Cauvy <g-cauvy1@xxxxxx>

When implementing the USB2 testmode support via debugfs,
Felipe has committed a mistake when counting the number
of letters of some of the strings, resulting on an off
by one error which prevented some of the Test modes to
be entered properly.

This patch, fixes that mistake.

Signed-off-by: Gerard Cauvy <g-cauvy1@xxxxxx>
Signed-off-by: Felipe Balbi <balbi@xxxxxx>
---
 drivers/usb/dwc3/debugfs.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
index 78ec092..d4a30f1 100644
--- a/drivers/usb/dwc3/debugfs.c
+++ b/drivers/usb/dwc3/debugfs.c
@@ -525,11 +525,11 @@ static ssize_t dwc3_testmode_write(struct file *file,
 		testmode = TEST_J;
 	else if (!strncmp(buf, "test_k", 6))
 		testmode = TEST_K;
-	else if (!strncmp(buf, "test_se0_nak", 13))
+	else if (!strncmp(buf, "test_se0_nak", 12))
 		testmode = TEST_SE0_NAK;
-	else if (!strncmp(buf, "test_packet", 12))
+	else if (!strncmp(buf, "test_packet", 11))
 		testmode = TEST_PACKET;
-	else if (!strncmp(buf, "test_force_enable", 18))
+	else if (!strncmp(buf, "test_force_enable", 17))
 		testmode = TEST_FORCE_EN;
 	else
 		testmode = 0;
-- 
1.7.9

--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux