diff options
author | Dust Li <dust.li@linux.alibaba.com> | 2022-03-09 06:30:51 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-03-10 07:02:35 +0300 |
commit | d9f50991592513cc7633684cbaff65022cfa6816 (patch) | |
tree | 10af52488d34ba5b73389b0ded4651d4d679f257 /net/smc | |
parent | c01e605904f1c8e25cfaecf04edaaa2824674065 (diff) | |
download | linux-d9f50991592513cc7633684cbaff65022cfa6816.tar.xz |
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: 7de8eb0d9039 ("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>
Diffstat (limited to 'net/smc')
-rw-r--r-- | net/smc/smc_sysctl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/smc/smc_sysctl.h b/net/smc/smc_sysctl.h index 1d554300604d..0becc11bd2f4 100644 --- a/net/smc/smc_sysctl.h +++ b/net/smc/smc_sysctl.h @@ -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 */ |