netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bpf: hide do_bpf_send_signal when unused
@ 2019-06-17 12:57 Arnd Bergmann
  2019-06-17 15:26 ` Alexei Starovoitov
  0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2019-06-17 12:57 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar, Alexei Starovoitov, Daniel Borkmann
  Cc: Arnd Bergmann, Andrii Nakryiko, Yonghong Song, Martin KaFai Lau,
	Song Liu, Matt Mullins, netdev, bpf, linux-kernel

When CONFIG_MODULES is disabled, this function is never called:

kernel/trace/bpf_trace.c:581:13: error: 'do_bpf_send_signal' defined but not used [-Werror=unused-function]

Add another #ifdef around it.

Fixes: 8b401f9ed244 ("bpf: implement bpf_send_signal() helper")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 kernel/trace/bpf_trace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index c102c240bb0b..b1a814e2d451 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -602,6 +602,7 @@ struct send_signal_irq_work {
 
 static DEFINE_PER_CPU(struct send_signal_irq_work, send_signal_work);
 
+#ifdef CONFIG_MODULES
 static void do_bpf_send_signal(struct irq_work *entry)
 {
 	struct send_signal_irq_work *work;
@@ -609,6 +610,7 @@ static void do_bpf_send_signal(struct irq_work *entry)
 	work = container_of(entry, struct send_signal_irq_work, irq_work);
 	group_send_sig_info(work->sig, SEND_SIG_PRIV, work->task, PIDTYPE_TGID);
 }
+#endif
 
 BPF_CALL_1(bpf_send_signal, u32, sig)
 {
-- 
2.20.0


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

end of thread, other threads:[~2019-06-24 20:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 12:57 [PATCH] bpf: hide do_bpf_send_signal when unused Arnd Bergmann
2019-06-17 15:26 ` Alexei Starovoitov
2019-06-17 23:09   ` Steven Rostedt
2019-06-17 23:13     ` Matt Mullins
2019-06-17 23:27       ` Alexei Starovoitov
2019-06-18  0:18         ` Steven Rostedt
2019-06-24 20:37           ` Yonghong Song

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).