Skip to content

Commit d9f5099

Browse files
Dust Likuba-moo
authored andcommitted
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. Fixes: 7de8eb0 ("net/smc: fix compile warning for smc_sysctl") Signed-off-by: Dust Li <dust.li@linux.alibaba.com> Link: https://lore.kernel.org/r/20220309033051.41893-1-dust.li@linux.alibaba.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent c01e605 commit d9f5099

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/smc/smc_sysctl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ void __net_exit smc_sysctl_net_exit(struct net *net);
2020

2121
#else
2222

23-
int __net_init smc_sysctl_net_init(struct net *net)
23+
static inline int smc_sysctl_net_init(struct net *net)
2424
{
2525
net->smc.sysctl_autocorking_size = SMC_AUTOCORKING_DEFAULT_SIZE;
2626
return 0;
2727
}
2828

29-
void __net_exit smc_sysctl_net_exit(struct net *net) { }
29+
static inline void smc_sysctl_net_exit(struct net *net) { }
3030

3131
#endif /* CONFIG_SYSCTL */
3232

0 commit comments

Comments
 (0)