From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Arnd Bergmann <arnd@arndb.de>
Subject: [for-next][PATCH 2/4] tracing: mark trace_test_buffer as __maybe_unused
Date: Mon, 16 Oct 2017 18:02:41 -0400 [thread overview]
Message-ID: <20171016220254.785554428@goodmis.org> (raw)
In-Reply-To: <20171016220239.257019816@goodmis.org>
[-- Attachment #1: 0002-tracing-mark-trace_test_buffer-as-__maybe_unused.patch --]
[-- Type: text/plain, Size: 1454 bytes --]
From: Arnd Bergmann <arnd@arndb.de>
After trace_selftest_startup_sched_switch is removed, trace_test_buffer()
is only used sometimes, leading to this warning:
kernel/trace/trace_selftest.c:62:12: error: 'trace_test_buffer' defined but not used [-Werror=unused-function]
There is no simple #ifdef condition that captures well whether the
function is in fact used or not, so marking it as __maybe_unused is
probably the best way to shut up the warning. The function will then
be silently dropped when there is no user.
Link: http://lkml.kernel.org/r/20171013142227.1273469-1-arnd@arndb.de
Fixes: d8c4deee6dc6 ("tracing: Remove obsolete sched_switch tracer selftest")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
kernel/trace/trace_selftest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index 364f78abdf47..eb9ba5c1ba40 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -59,7 +59,7 @@ static int trace_test_buffer_cpu(struct trace_buffer *buf, int cpu)
* Test the trace buffer to see if all the elements
* are still sane.
*/
-static int trace_test_buffer(struct trace_buffer *buf, unsigned long *count)
+static int __maybe_unused trace_test_buffer(struct trace_buffer *buf, unsigned long *count)
{
unsigned long flags, cnt = 0;
int cpu, ret = 0;
--
2.13.2
next prev parent reply other threads:[~2017-10-16 22:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-16 22:02 [for-next][PATCH 0/4] tracing: Some more updates for 4.15 Steven Rostedt
2017-10-16 22:02 ` [for-next][PATCH 1/4] printk: Remove superfluous memory barriers from printk_safe Steven Rostedt
2017-10-16 22:02 ` Steven Rostedt [this message]
2017-10-16 22:02 ` [for-next][PATCH 3/4] tracing/xen: Hide events that are not used when X86_PAE is not defined Steven Rostedt
2017-10-16 22:02 ` [for-next][PATCH 4/4] tracing, memcg, vmscan: Hide trace events when not in use Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171016220254.785554428@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome