net/tls: Fix unused function warning
authorYueHaibing <yuehaibing@huawei.com>
Thu, 14 Nov 2019 07:39:46 +0000 (15:39 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Nov 2019 20:12:28 +0000 (12:12 -0800)
If PROC_FS is not set, gcc warning this:

net/tls/tls_proc.c:23:12: warning:
 'tls_statistics_seq_show' defined but not used [-Wunused-function]

Use #ifdef to guard this.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_proc.c

index 83d9c80a684ef06729471510d2899c2aa260090f..3a5dd1e072332e0b93d35fdb128329887094c0c8 100644 (file)
@@ -6,6 +6,7 @@
 #include <net/snmp.h>
 #include <net/tls.h>
 
+#ifdef CONFIG_PROC_FS
 static const struct snmp_mib tls_mib_list[] = {
        SNMP_MIB_ITEM("TlsCurrTxSw", LINUX_MIB_TLSCURRTXSW),
        SNMP_MIB_ITEM("TlsCurrRxSw", LINUX_MIB_TLSCURRRXSW),
@@ -32,6 +33,7 @@ static int tls_statistics_seq_show(struct seq_file *seq, void *v)
 
        return 0;
 }
+#endif
 
 int __net_init tls_proc_init(struct net *net)
 {