Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: dwc3: debugfs: fix off by one when entering testmode

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@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

authored by

Gerard Cauvy and committed by
Felipe Balbi
09072543 2e81c36a

+3 -3
+3 -3
drivers/usb/dwc3/debugfs.c
··· 525 525 testmode = TEST_J; 526 526 else if (!strncmp(buf, "test_k", 6)) 527 527 testmode = TEST_K; 528 - else if (!strncmp(buf, "test_se0_nak", 13)) 528 + else if (!strncmp(buf, "test_se0_nak", 12)) 529 529 testmode = TEST_SE0_NAK; 530 - else if (!strncmp(buf, "test_packet", 12)) 530 + else if (!strncmp(buf, "test_packet", 11)) 531 531 testmode = TEST_PACKET; 532 - else if (!strncmp(buf, "test_force_enable", 18)) 532 + else if (!strncmp(buf, "test_force_enable", 17)) 533 533 testmode = TEST_FORCE_EN; 534 534 else 535 535 testmode = 0;