LKML Archive on
 help / color / Atom feed
From: Mathieu Malaterre <>
To: Steven Rostedt <>
Cc: Mathieu Malaterre <>,
	Ingo Molnar <>,
Subject: [PATCH] trace: Use __printf markup to silence compiler
Date: Thu,  8 Mar 2018 21:58:43 +0100
Message-ID: <> (raw)

Silence warnings (triggered at W=1) by adding relevant __printf attributes.

  CC      kernel/trace/trace.o
kernel/trace/trace.c: In function ‘__trace_array_vprintk’:
kernel/trace/trace.c:2979:2: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
  len = vscnprintf(tbuffer, TRACE_BUF_SIZE, fmt, args);
  AR      kernel/trace/built-in.o

Signed-off-by: Mathieu Malaterre <>
 kernel/trace/trace.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 926718fa846d..117e246d0a49 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2949,6 +2949,7 @@ int trace_vbprintk(unsigned long ip, const char *fmt, va_list args)
+__printf(3, 0)
 static int
 __trace_array_vprintk(struct ring_buffer *buffer,
 		      unsigned long ip, const char *fmt, va_list args)
@@ -3003,12 +3004,14 @@ __trace_array_vprintk(struct ring_buffer *buffer,
 	return len;
+__printf(3, 0)
 int trace_array_vprintk(struct trace_array *tr,
 			unsigned long ip, const char *fmt, va_list args)
 	return __trace_array_vprintk(tr->trace_buffer.buffer, ip, fmt, args);
+__printf(3, 0)
 int trace_array_printk(struct trace_array *tr,
 		       unsigned long ip, const char *fmt, ...)
@@ -3024,6 +3027,7 @@ int trace_array_printk(struct trace_array *tr,
 	return ret;
+__printf(3, 4)
 int trace_array_printk_buf(struct ring_buffer *buffer,
 			   unsigned long ip, const char *fmt, ...)
@@ -3039,6 +3043,7 @@ int trace_array_printk_buf(struct ring_buffer *buffer,
 	return ret;
+__printf(2, 0)
 int trace_vprintk(unsigned long ip, const char *fmt, va_list args)
 	return trace_array_vprintk(&global_trace, ip, fmt, args);

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox