public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>
Subject: [PATCH 01/13 -next] tracing: Fix sparse warning with is_signed_type() macro
Date: Mon, 21 Jan 2013 16:14:04 -0500	[thread overview]
Message-ID: <20130121211727.461496092@goodmis.org> (raw)
In-Reply-To: 20130121211403.337052956@goodmis.org

[-- Attachment #1: 0001-tracing-Fix-sparse-warning-with-is_signed_type-macro.patch --]
[-- Type: text/plain, Size: 1406 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

Sparse complains when is_signed_type() is used on a pointer.
This macro is needed for the format output used for ftrace
and perf, to know if a binary field is a signed type or not.
The is_signed_type() macro is used against all fields that are
recorded by events to automate the operation.

The problem sparse has is with the current way is_signed_type()
works:

  ((type)-1 < 0)

If "type" is a poiner, than sparse does not like it being compared
to an integer (zero). The simple fix is to just give zero the
same type. The runtime result stays the same.

Reported-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/ftrace_event.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index a3d4895..43ef8b6 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -272,7 +272,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type,
 extern int trace_add_event_call(struct ftrace_event_call *call);
 extern void trace_remove_event_call(struct ftrace_event_call *call);
 
-#define is_signed_type(type)	(((type)(-1)) < 0)
+#define is_signed_type(type)	(((type)(-1)) < (type)0)
 
 int trace_set_clr_event(const char *system, const char *event, int set);
 
-- 
1.7.10.4



  reply	other threads:[~2013-01-21 21:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 21:14 [PATCH 00/13 -next] [For linux-next] tracing: Review of changes Steven Rostedt
2013-01-21 21:14 ` Steven Rostedt [this message]
2013-01-21 21:14 ` [PATCH 02/13 -next] ring-buffer: Remove unnecessary recusive call in rb_advance_iter() Steven Rostedt
2013-01-21 21:14 ` [PATCH 03/13 -next] tracing: Use this_cpu_ptr per-cpu helper Steven Rostedt
2013-01-21 21:14 ` [PATCH 04/13 -next] tracing: Verify target file before registering a uprobe event Steven Rostedt
2013-01-21 21:14 ` [PATCH 05/13 -next] tracing/syscalls: Make local functions static Steven Rostedt
2013-01-21 21:14 ` [PATCH 06/13 -next] tracing: Add checks if tr->buffer is NULL in tracing_reset{_online_cpus} Steven Rostedt
2013-01-21 21:14 ` [PATCH 07/13 -next] tracing: Remove unneeded check of max_tr->buffer before tracing_reset Steven Rostedt
2013-01-21 21:14 ` [PATCH 08/13 -next] tracing/lockdep: Disable lockdep first in entering NMI Steven Rostedt
2013-01-21 21:14 ` [PATCH 09/13 -next] tracing/fgraph: Add max_graph_depth to limit function_graph depth Steven Rostedt
2013-01-21 21:14 ` [PATCH 10/13 -next] ftrace: Move ARCH_SUPPORTS_FTRACE_SAVE_REGS in Kconfig Steven Rostedt
2013-01-21 21:14 ` [PATCH 11/13 -next] kprobes/x86: Move ftrace-based kprobe code into kprobes-ftrace.c Steven Rostedt
2013-01-21 21:14 ` [PATCH 12/13 -next] kprobes/x86: Move kprobes stuff under arch/x86/kernel/kprobes/ Steven Rostedt
2013-01-21 21:14 ` [PATCH 13/13 -next] tracing: Remove the extra 4 bytes of padding in events Steven Rostedt
2013-01-21 23:13   ` Arjan van de Ven

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=20130121211727.461496092@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=robert.jarzmik@free.fr \
    /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