Skip to content

Commit

Permalink
net/tls: Fix unused function warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YueHaibing authored and David S. Miller committed Nov 15, 2019
1 parent a98cdaf commit d6649d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/tls/tls_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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)
{
Expand Down

0 comments on commit d6649d7

Please sign in to comment.