lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220302034312.31168-1-dust.li@linux.alibaba.com>
Date:   Wed,  2 Mar 2022 11:43:12 +0800
From:   Dust Li <dust.li@...ux.alibaba.com>
To:     Karsten Graul <kgraul@...ux.ibm.com>,
        Tony Lu <tonylu@...ux.alibaba.com>, davem@...emloft.net,
        kuba@...nel.org
Cc:     netdev@...r.kernel.org, linux-s390@...r.kernel.org,
        linux-rdma@...r.kernel.org
Subject: [PATCH net-next] net/smc: fix compile warning for smc_sysctl

Fix build:

   In file included from net/smc/smc_sysctl.c:17:
>> net/smc/smc_sysctl.h:23:5: warning: no previous prototype \
	for function 'smc_sysctl_init' [-Wmissing-prototypes]
   int smc_sysctl_init(void)
       ^

and

>> WARNING: modpost: vmlinux.o(.text+0x12ced2d): Section mismatch \
in reference from the function smc_sysctl_exit() to the variable
.init.data:smc_sysctl_ops
The function smc_sysctl_exit() references
the variable __initdata smc_sysctl_ops.
This is often because smc_sysctl_exit lacks a __initdata
annotation or the annotation of smc_sysctl_ops is wrong.

Fixes: 462791bbfa35 ("net/smc: add sysctl interface for SMC")
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Dust Li <dust.li@...ux.alibaba.com>
---
 net/smc/smc_sysctl.c | 4 ++--
 net/smc/smc_sysctl.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/smc/smc_sysctl.c b/net/smc/smc_sysctl.c
index 3b59876aaac9..e6f926757ecb 100644
--- a/net/smc/smc_sysctl.c
+++ b/net/smc/smc_sysctl.c
@@ -69,12 +69,12 @@ static struct pernet_operations smc_sysctl_ops __net_initdata = {
 	.exit = smc_sysctl_exit_net,
 };
 
-int __init smc_sysctl_init(void)
+int __net_init smc_sysctl_init(void)
 {
 	return register_pernet_subsys(&smc_sysctl_ops);
 }
 
-void smc_sysctl_exit(void)
+void __net_exit smc_sysctl_exit(void)
 {
 	unregister_pernet_subsys(&smc_sysctl_ops);
 }
diff --git a/net/smc/smc_sysctl.h b/net/smc/smc_sysctl.h
index 49553ac236b6..8914278ac870 100644
--- a/net/smc/smc_sysctl.h
+++ b/net/smc/smc_sysctl.h
@@ -20,12 +20,12 @@ void smc_sysctl_exit(void);
 
 #else
 
-int smc_sysctl_init(void)
+static inline int smc_sysctl_init(void)
 {
 	return 0;
 }
 
-void smc_sysctl_exit(void) { }
+static inline void smc_sysctl_exit(void) { }
 
 #endif /* CONFIG_SYSCTL */
 
-- 
2.19.1.3.ge56e4f7

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ