From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel@vger.kernel.org
Cc: Fabian Frederick <fabf@skynet.be>,
Jaroslav Kysela <perex@perex.cz>,
netdev@vger.kernel.org
Subject: [PATCH 1/1 linux-next] hp100: simplify hp100_module_init
Date: Sat, 3 Jan 2015 14:44:16 +0100 [thread overview]
Message-ID: <1420292656-14429-1-git-send-email-fabf@skynet.be> (raw)
-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@skynet.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
next reply other threads:[~2015-01-03 13:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-03 13:44 Fabian Frederick [this message]
2015-01-05 3:23 ` [PATCH 1/1 linux-next] hp100: simplify hp100_module_init David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420292656-14429-1-git-send-email-fabf@skynet.be \
--to=fabf@skynet.be \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=perex@perex.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).