lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat,  3 Jan 2015 14:44:16 +0100
From:	Fabian Frederick <fabf@...net.be>
To:	linux-kernel@...r.kernel.org
Cc:	Fabian Frederick <fabf@...net.be>,
	Jaroslav Kysela <perex@...ex.cz>, netdev@...r.kernel.org
Subject: [PATCH 1/1 linux-next] hp100: simplify hp100_module_init

-Avoid double goto and directly return err where possible.
-Remove unused labels which fixes:

drivers/net/ethernet/hp/hp100.c:3047:2: warning: label
'out3' defined but not used [-Wunused-label]

Signed-off-by: Fabian Frederick <fabf@...net.be>
---
This is untested.

 drivers/net/ethernet/hp/hp100.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/hp/hp100.c b/drivers/net/ethernet/hp/hp100.c
index ae6e30d..7155938 100644
--- a/drivers/net/ethernet/hp/hp100.c
+++ b/drivers/net/ethernet/hp/hp100.c
@@ -3031,26 +3031,25 @@ static int __init hp100_module_init(void)
 
 	err = hp100_isa_init();
 	if (err && err != -ENODEV)
-		goto out;
+		return err;
 #ifdef CONFIG_EISA
 	err = eisa_driver_register(&hp100_eisa_driver);
 	if (err && err != -ENODEV)
-		goto out2;
+		goto out_eisa;
+	else
+		return err;
 #endif
 #ifdef CONFIG_PCI
 	err = pci_register_driver(&hp100_pci_driver);
-	if (err && err != -ENODEV)
-		goto out3;
+	if (!err || err == -ENODEV)
+		return err;
 #endif
- out:
-	return err;
- out3:
 #ifdef CONFIG_EISA
 	eisa_driver_unregister (&hp100_eisa_driver);
- out2:
+ out_eisa:
 #endif
 	hp100_isa_cleanup();
-	goto out;
+	return err;
 }
 
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists