Message ID | dac675d4-2dbd-e16d-622a-0471f31f2aca@omp.ru (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | usb: core: devices: drop unreachable code in usb_dump_endpoint_descriptor() | expand |
On 2/8/22 10:58 PM, Sergey Shtylyov wrote: > The *switch* statement in usb_dump_endpoint_descriptor() does handle all > possible endpoint types expilictly, so the *defaut* label is unreachable. It's *default*. :-) Please fix when/if merging! > > Found by Linux Verification Center (linuxtesting.org) with the SVACE static > analysis tool. > > Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> [...] MBR, Sergey
On 2/8/22 11:01 PM, Sergey Shtylyov wrote: >> The *switch* statement in usb_dump_endpoint_descriptor() does handle all >> possible endpoint types expilictly, so the *defaut* label is unreachable. > > It's *default*. :-) Please fix when/if merging! Oh, and it's expilicitly! :-/ >> Found by Linux Verification Center (linuxtesting.org) with the SVACE static >> analysis tool. >> >> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> > > [...] MBR, Sergey
On Tue, Feb 08, 2022 at 11:01:09PM +0300, Sergey Shtylyov wrote: > On 2/8/22 10:58 PM, Sergey Shtylyov wrote: > > > The *switch* statement in usb_dump_endpoint_descriptor() does handle all > > possible endpoint types expilictly, so the *defaut* label is unreachable. > > It's *default*. :-) Please fix when/if merging! I can not easily change changelog texts when applying patches as the tools suck the patch in from the public archive, sorry. Please resend.
Index: usb/drivers/usb/core/devices.c =================================================================== --- usb.orig/drivers/usb/core/devices.c +++ usb/drivers/usb/core/devices.c @@ -168,8 +168,6 @@ static char *usb_dump_endpoint_descripto case USB_ENDPOINT_XFER_INT: type = "Int."; break; - default: /* "can't happen" */ - return start; } interval = usb_decode_interval(desc, speed);
The *switch* statement in usb_dump_endpoint_descriptor() does handle all possible endpoint types expilictly, so the *defaut* label is unreachable. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> --- This patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo. drivers/usb/core/devices.c | 2 -- 1 file changed, 2 deletions(-)