linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: core: devices: drop unreachable code in usb_dump_endpoint_descriptor()
@ 2022-02-08 19:58 Sergey Shtylyov
  2022-02-08 20:01 ` Sergey Shtylyov
  0 siblings, 1 reply; 4+ messages in thread
From: Sergey Shtylyov @ 2022-02-08 19:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb

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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: core: devices: drop unreachable code in usb_dump_endpoint_descriptor()
  2022-02-08 19:58 [PATCH] usb: core: devices: drop unreachable code in usb_dump_endpoint_descriptor() Sergey Shtylyov
@ 2022-02-08 20:01 ` Sergey Shtylyov
  2022-02-08 20:27   ` Sergey Shtylyov
  2022-02-09  5:34   ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Sergey Shtylyov @ 2022-02-08 20:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: core: devices: drop unreachable code in usb_dump_endpoint_descriptor()
  2022-02-08 20:01 ` Sergey Shtylyov
@ 2022-02-08 20:27   ` Sergey Shtylyov
  2022-02-09  5:34   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Sergey Shtylyov @ 2022-02-08 20:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: core: devices: drop unreachable code in usb_dump_endpoint_descriptor()
  2022-02-08 20:01 ` Sergey Shtylyov
  2022-02-08 20:27   ` Sergey Shtylyov
@ 2022-02-09  5:34   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2022-02-09  5:34 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: linux-usb

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-09  5:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-08 19:58 [PATCH] usb: core: devices: drop unreachable code in usb_dump_endpoint_descriptor() Sergey Shtylyov
2022-02-08 20:01 ` Sergey Shtylyov
2022-02-08 20:27   ` Sergey Shtylyov
2022-02-09  5:34   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).