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>
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 4488d90..fa32ca3 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -448,8 +448,9 @@
}
#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 @@
/* 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),