rtnetlink: wire up rtnl_net_debug_exit
Subsystems (2)
PATCH 1/1 rtnetlink: wire up rtnl_net_debug_exit
From: Arnd Bergmann <[email protected]>
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.
--- net/core/rtnl_net_debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/core/rtnl_net_debug.c +3 -3
@@ -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);
Signature · 1 line
2.39.5
Quoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
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__exitrtnl_net_debug_exit(void)| ^~~~~~~~~~~~~~~~~~~
Quoted 8 lines
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_initdataannotation onrtnl_net_debug_net_opsto ensure the structure remains there.Fixes 03fa53485659 ("rtnetlink: Add ASSERT_RTNL_NET() placeholder for netdev notifier.")Signed-off-by Arnd Bergmann <[email protected]>---
This was fixed with :
commit bb9df28e6fcda6a96860e7b77f3912ef50e06793
Author: Kuniyuki Iwashima <[email protected]> Date: Thu Oct 10 10:24:33 2024 -0700
rtnl_net_debug: Remove rtnl_net_debug_exit().
kernel test robot reported section mismatch in rtnl_net_debug_exit().
WARNING: modpost: vmlinux: section mismatch in reference:rtnl_net_debug_exit+0x20 (section: .exit.text) -> rtnl_net_debug_net_ops (section: .init.data)
rtnl_net_debug_exit() uses rtnl_net_debug_net_ops() that is annotated as __net_initdata, but this file is always built-in.
Let's remove rtnl_net_debug_exit().
for netdev notifier.")
net/core/rtnl_net_debug.c +0 -0
100644
net/core/rtnl_net_debug.c +0 -6
@@ -122,10 +122,4 @@ static int __init rtnl_net_debug_init(void)return ret; } -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);