Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: ohci: remove unreachable platform_driver_unregister() call
@ 2021-03-20  1:31 Jay Fang
  2021-03-20  2:24 ` Alan Stern
  0 siblings, 1 reply; 4+ messages in thread
From: Jay Fang @ 2021-03-20  1:31 UTC (permalink / raw)
  To: stern; +Cc: linux-usb, tangzihao1, dan.carpenter, huangdaode

From: Zihao Tang <tangzihao1@hisilicon.com>

Fix the following smatch warnings:

drivers/usb/host/ohci-hcd.c:1318 ohci_hcd_mod_init() warn:
ignoring unreachable code.

platform_driver_register(&TMIO_OHCI_DRIVER) is the last
platform_driver_register() call in ohci_hcd_mod_init(), so if it
failed, there's no need to unregister it, but just goto error_tmio.

So remove the unreachable platform_driver_unregister(&TMIO_OHCI_DRIVER).
No functionality change.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zihao Tang <tangzihao1@hisilicon.com>
Signed-off-by: Jay Fang <f.fangjian@huawei.com>
---
 drivers/usb/host/ohci-hcd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 1f5e693..2d09ef2 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1319,7 +1319,6 @@ static int __init ohci_hcd_mod_init(void)
 
 	/* Error path */
 #ifdef TMIO_OHCI_DRIVER
-	platform_driver_unregister(&TMIO_OHCI_DRIVER);
  error_tmio:
 #endif
 #ifdef SM501_OHCI_DRIVER
-- 
2.7.4


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

end of thread, other threads:[~2021-03-22 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-20  1:31 [PATCH] usb: ohci: remove unreachable platform_driver_unregister() call Jay Fang
2021-03-20  2:24 ` Alan Stern
2021-03-22  4:58   ` Dan Carpenter
2021-03-22 16:44     ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox