All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] rtnetlink: wire up rtnl_net_debug_exit
Date: Tue, 15 Oct 2024 15:10:36 +0000	[thread overview]
Message-ID: <20241015151045.2353801-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

The function is never called, but causes a build warning:

net/core/rtnl_net_debug.c:125:20: error: 'rtnl_net_debug_exit' defined but not used [-Werror=unused-function]
  125 | static void __exit rtnl_net_debug_exit(void)
      |                    ^~~~~~~~~~~~~~~~~~~
WARNING: modpost: vmlinux: section mismatch in reference: rtnl_net_debug_exit+0x1c (section: .exit.text) -> rtnl_net_debug_net_ops (section: .init.data)

Use this as the exitcall as was clearly intended and remove the __net_initdata
annotation on rtnl_net_debug_net_ops to ensure the structure remains there.

Fixes: 03fa53485659 ("rtnetlink: Add ASSERT_RTNL_NET() placeholder for netdev notifier.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 net/core/rtnl_net_debug.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/core/rtnl_net_debug.c b/net/core/rtnl_net_debug.c
index e90a32242e22..efb8a5bc9ee4 100644
--- a/net/core/rtnl_net_debug.c
+++ b/net/core/rtnl_net_debug.c
@@ -96,7 +96,7 @@ static void __net_exit rtnl_net_debug_net_exit(struct net *net)
 	unregister_netdevice_notifier_net(net, nb);
 }
 
-static struct pernet_operations rtnl_net_debug_net_ops __net_initdata = {
+static struct pernet_operations rtnl_net_debug_net_ops = {
 	.init = rtnl_net_debug_net_init,
 	.exit = rtnl_net_debug_net_exit,
 	.id = &rtnl_net_debug_net_id,
@@ -121,11 +121,11 @@ static int __init rtnl_net_debug_init(void)
 
 	return ret;
 }
+subsys_initcall(rtnl_net_debug_init);
 
 static void __exit rtnl_net_debug_exit(void)
 {
 	unregister_netdevice_notifier(&rtnl_net_debug_block);
 	unregister_pernet_device(&rtnl_net_debug_net_ops);
 }
-
-subsys_initcall(rtnl_net_debug_init);
+module_exit(rtnl_net_debug_exit);
-- 
2.39.5


             reply	other threads:[~2024-10-15 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-15 15:10 Arnd Bergmann [this message]
2024-10-15 15:20 ` [PATCH] rtnetlink: wire up rtnl_net_debug_exit Eric Dumazet

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=20241015151045.2353801-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.