aboutsummaryrefslogtreecommitdiff
path: root/kernel/trace/trace_events.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-03-06 10:50:53 -0500
committerSteven Rostedt <srostedt@redhat.com>2009-03-10 00:34:03 -0400
commit156b5f172a64103bcb13b6d26288388b9019caa3 (patch)
treee29141720bd9d0e4c722dd3c7dc8c62d5113db43 /kernel/trace/trace_events.c
parent7bffc23e56e92c14b787bf4d95249a32085bfed5 (diff)
tracing: typecast sizeof and offsetof to unsigned int
Impact: fix compiler warnings On x86_64 sizeof and offsetof are treated as long, where as on x86_32 they are int. This patch typecasts them to unsigned int to avoid one arch giving warnings while the other does not. Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r--kernel/trace/trace_events.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 4488d90e75e..fa32ca32076 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -448,8 +448,9 @@ event_available_types_read(struct file *filp, char __user *ubuf, size_t cnt,
}
#undef FIELD
-#define FIELD(type, name) \
- #type, #name, offsetof(typeof(field), name), sizeof(field.name)
+#define FIELD(type, name) \
+ #type, #name, (unsigned int)offsetof(typeof(field), name), \
+ (unsigned int)sizeof(field.name)
static int trace_write_header(struct trace_seq *s)
{
@@ -457,11 +458,11 @@ static int trace_write_header(struct trace_seq *s)
/* struct trace_entry */
return trace_seq_printf(s,
- "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
- "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
- "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
- "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
- "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
+ "\tfield:%s %s;\toffset:%u;\tsize:%u;\n"
+ "\tfield:%s %s;\toffset:%u;\tsize:%u;\n"
+ "\tfield:%s %s;\toffset:%u;\tsize:%u;\n"
+ "\tfield:%s %s;\toffset:%u;\tsize:%u;\n"
+ "\tfield:%s %s;\toffset:%u;\tsize:%u;\n"
"\n",
FIELD(unsigned char, type),
FIELD(unsigned char, flags),