netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/tls: Fix unused function warning
@ 2019-11-14  7:39 YueHaibing
  2019-11-14 17:00 ` Jakub Kicinski
  2019-11-15 20:12 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2019-11-14  7:39 UTC (permalink / raw)
  To: borisp, aviadye, john.fastabend, daniel, jakub.kicinski, davem
  Cc: netdev, linux-kernel, YueHaibing

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>
---
 net/tls/tls_proc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/tls/tls_proc.c b/net/tls/tls_proc.c
index 83d9c80..3a5dd1e 100644
--- a/net/tls/tls_proc.c
+++ b/net/tls/tls_proc.c
@@ -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)
 {
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net/tls: Fix unused function warning
  2019-11-14  7:39 [PATCH net-next] net/tls: Fix unused function warning YueHaibing
@ 2019-11-14 17:00 ` Jakub Kicinski
  2019-11-15 20:12 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2019-11-14 17:00 UTC (permalink / raw)
  To: YueHaibing
  Cc: borisp, aviadye, john.fastabend, daniel, davem, netdev,
	linux-kernel

On Thu, 14 Nov 2019 15:39:46 +0800, YueHaibing wrote:
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net/tls: Fix unused function warning
  2019-11-14  7:39 [PATCH net-next] net/tls: Fix unused function warning YueHaibing
  2019-11-14 17:00 ` Jakub Kicinski
@ 2019-11-15 20:12 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-11-15 20:12 UTC (permalink / raw)
  To: yuehaibing
  Cc: borisp, aviadye, john.fastabend, daniel, jakub.kicinski, netdev,
	linux-kernel

From: YueHaibing <yuehaibing@huawei.com>
Date: Thu, 14 Nov 2019 15:39:46 +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>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-15 20:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-14  7:39 [PATCH net-next] net/tls: Fix unused function warning YueHaibing
2019-11-14 17:00 ` Jakub Kicinski
2019-11-15 20:12 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).