linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: common: usb-otg-fsm: drop unreachable code in otg_statemachine()
@ 2022-02-08 20:32 Sergey Shtylyov
  2022-02-09  5:35 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Sergey Shtylyov @ 2022-02-08 20:32 UTC (permalink / raw)
  To: Peter Chen, Greg Kroah-Hartman, linux-usb

The *switch* statement in otg_statemachine() does handle all possible OTG
states explicitly, so the *default* 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.
Peter Chen's 'usb.git' repo seems outdated, so I chose to ignore it...

 drivers/usb/common/usb-otg-fsm.c |    2 --
 1 file changed, 2 deletions(-)

Index: usb/drivers/usb/common/usb-otg-fsm.c
===================================================================
--- usb.orig/drivers/usb/common/usb-otg-fsm.c
+++ usb/drivers/usb/common/usb-otg-fsm.c
@@ -440,8 +440,6 @@ int otg_statemachine(struct otg_fsm *fsm
 		if (fsm->id || fsm->a_bus_drop || fsm->a_clr_err)
 			otg_set_state(fsm, OTG_STATE_A_WAIT_VFALL);
 		break;
-	default:
-		break;
 	}
 	mutex_unlock(&fsm->lock);
 

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-08 20:32 [PATCH] usb: common: usb-otg-fsm: drop unreachable code in otg_statemachine() Sergey Shtylyov
2022-02-09  5:35 ` Greg Kroah-Hartman
2022-02-09 10:33   ` Sergey Shtylyov
2022-02-09 11:33     ` 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).