From: Arnd Bergmann <arnd@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Arnd Bergmann <arnd@arndb.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Armin Wolf <W_Armin@gmx.de>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ne2000: fix unused function warning
Date: Tue, 7 Sep 2021 15:10:30 +0200 [thread overview]
Message-ID: <20210907131046.117800-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
Geert noticed a warning on MIPS TX49xx:
drivers/net/ethernet/8390/ne.c:909:20: warning: ‘ne_add_devices’ defined but not used [-Wunused-function]
Move the function into the #ifdef section that contains its
only caller.
Fixes: 4228c3942821 ("make legacy ISA probe optional")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/8390/ne.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c
index 53660bc8d6ff..1f7525f55994 100644
--- a/drivers/net/ethernet/8390/ne.c
+++ b/drivers/net/ethernet/8390/ne.c
@@ -906,22 +906,6 @@ static struct platform_driver ne_driver = {
},
};
-static void __init ne_add_devices(void)
-{
- int this_dev;
- struct platform_device *pdev;
-
- for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
- if (pdev_ne[this_dev])
- continue;
- pdev = platform_device_register_simple(
- DRV_NAME, this_dev, NULL, 0);
- if (IS_ERR(pdev))
- continue;
- pdev_ne[this_dev] = pdev;
- }
-}
-
#ifdef MODULE
static int __init ne_init(void)
{
@@ -953,6 +937,22 @@ static int __init ne_init(void)
module_init(ne_init);
#ifdef CONFIG_NETDEV_LEGACY_INIT
+static void __init ne_add_devices(void)
+{
+ int this_dev;
+ struct platform_device *pdev;
+
+ for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
+ if (pdev_ne[this_dev])
+ continue;
+ pdev = platform_device_register_simple(
+ DRV_NAME, this_dev, NULL, 0);
+ if (IS_ERR(pdev))
+ continue;
+ pdev_ne[this_dev] = pdev;
+ }
+}
+
struct net_device * __init ne_probe(int unit)
{
int this_dev;
--
2.29.2
next reply other threads:[~2021-09-07 13:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 13:10 Arnd Bergmann [this message]
2021-09-07 13:19 ` [PATCH] ne2000: fix unused function warning Geert Uytterhoeven
2021-09-07 13:30 ` Arnd Bergmann
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=20210907131046.117800-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=W_Armin@gmx.de \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=geert@linux-m68k.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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