]> git.baikalelectronics.ru Git - kernel.git/commit
usb: musb: Fix a few off-by-one lengths
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 27 Nov 2014 21:25:45 +0000 (22:25 +0100)
committerFelipe Balbi <balbi@ti.com>
Mon, 22 Dec 2014 16:25:37 +0000 (10:25 -0600)
commita96601d90f11144520458a771dce6a803cc46d75
treedd12c2eb2b2439a5bbcfae0188e6f3c1429e9d02
parentefeb9c2fec454d1ba6b5b939099a26f658c58053
usb: musb: Fix a few off-by-one lengths

!strncmp(buf, "force host", 9) is true if and only if buf starts with
"force hos". This was obviously not what was intended. The same error
exists for "force full-speed", "force high-speed" and "test
packet". Using strstarts avoids the error-prone hardcoding of the
prefix length.

For consistency, also change the other occurences of the !strncmp
idiom.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_cppi41.c
drivers/usb/musb/musb_debugfs.c