diff mbox series

usb: core: devices: drop unreachable code in usb_dump_endpoint_descriptor()

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

Commit Message

Sergey Shtylyov Feb. 8, 2022, 7:58 p.m. UTC
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(-)

Comments

Sergey Shtylyov Feb. 8, 2022, 8:01 p.m. UTC | #1
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
Sergey Shtylyov Feb. 8, 2022, 8:27 p.m. UTC | #2
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
Greg KH Feb. 9, 2022, 5:34 a.m. UTC | #3
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.
diff mbox series

Patch

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