linux-stable/net/smc/smc_sysctl.h
Dust Li d9f5099159 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: 7de8eb0d90 ("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>
2022-03-09 20:02:35 -08:00

33 lines
691 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Shared Memory Communications over RDMA (SMC-R) and RoCE
*
* smc_sysctl.c: sysctl interface to SMC subsystem.
*
* Copyright (c) 2022, Alibaba Inc.
*
* Author: Tony Lu <tonylu@linux.alibaba.com>
*
*/
#ifndef _SMC_SYSCTL_H
#define _SMC_SYSCTL_H
#ifdef CONFIG_SYSCTL
int __net_init smc_sysctl_net_init(struct net *net);
void __net_exit smc_sysctl_net_exit(struct net *net);
#else
static inline int smc_sysctl_net_init(struct net *net)
{
net->smc.sysctl_autocorking_size = SMC_AUTOCORKING_DEFAULT_SIZE;
return 0;
}
static inline void smc_sysctl_net_exit(struct net *net) { }
#endif /* CONFIG_SYSCTL */
#endif /* _SMC_SYSCTL_H */