net/smc: fix -Wmissing-prototypes warning when CONFIG_SYSCTL not set
Subsystems (5)
Dust Li
maintainerPATCH 1/1 net/smc: fix -Wmissing-prototypes warning when CONFIG_SYSCTL not set
when CONFIG_SYSCTL not set, smc_sysctl_net_init/exit need to be static inline to avoid missing-prototypes if compile with W=1.
Since __net_exit has noinline annotation when CONFIG_NET_NS not set, it should not be used with static inline. So remove the __net_init/exit when CONFIG_SYSCTL not set.
--- net/smc/smc_sysctl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/smc/smc_sysctl.h +2 -2
@@ -20,13 +20,13 @@ void __net_exit smc_sysctl_net_exit(struct net *net);#else -int __net_init smc_sysctl_net_init (struct net *net) +static inline int smc_sysctl_net_init (struct net *net) { net->smc.sysctl_autocorking_size =SMC_AUTOCORKING_DEFAULT_SIZE ;return 0 ; } -void __net_exit smc_sysctl_net_exit(struct net *net) { } +static inline void smc_sysctl_net_exit (struct net *net) { }#endif /* CONFIG_SYSCTL */
Signature · 1 line
2.19.1.3.ge56e4f7
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Wed, 9 Mar 2022 11:30:51 +0800 you wrote:
when
CONFIG_SYSCTLnot set, smc_sysctl_net_init/exit need to be static inline to avoid missing-prototypes if compile with W=1.Since
__net_exithas noinline annotation whenCONFIG_NET_NSnot set, it should not be used with static inline. So remove the __net_init/exit whenCONFIG_SYSCTLnot set.[...]
Here is the summary with links:
- [net-next] net/smc: fix -Wmissing-prototypes warning when CONFIG_SYSCTL not set
https://git.kernel.org/netdev/net-next/c/d9f509915925
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html