diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-03-06 10:50:53 -0500 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-03-10 00:34:03 -0400 |
commit | 156b5f172a64103bcb13b6d26288388b9019caa3 (patch) | |
tree | e29141720bd9d0e4c722dd3c7dc8c62d5113db43 /kernel/trace/trace_events.c | |
parent | 7bffc23e56e92c14b787bf4d95249a32085bfed5 (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.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 4488d90e75ef..fa32ca320767 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, | |||
448 | } | 448 | } |
449 | 449 | ||
450 | #undef FIELD | 450 | #undef FIELD |
451 | #define FIELD(type, name) \ | 451 | #define FIELD(type, name) \ |
452 | #type, #name, offsetof(typeof(field), name), sizeof(field.name) | 452 | #type, #name, (unsigned int)offsetof(typeof(field), name), \ |
453 | (unsigned int)sizeof(field.name) | ||
453 | 454 | ||
454 | static int trace_write_header(struct trace_seq *s) | 455 | static int trace_write_header(struct trace_seq *s) |
455 | { | 456 | { |
@@ -457,11 +458,11 @@ static int trace_write_header(struct trace_seq *s) | |||
457 | 458 | ||
458 | /* struct trace_entry */ | 459 | /* struct trace_entry */ |
459 | return trace_seq_printf(s, | 460 | return trace_seq_printf(s, |
460 | "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n" | 461 | "\tfield:%s %s;\toffset:%u;\tsize:%u;\n" |
461 | "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n" | 462 | "\tfield:%s %s;\toffset:%u;\tsize:%u;\n" |
462 | "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n" | 463 | "\tfield:%s %s;\toffset:%u;\tsize:%u;\n" |
463 | "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n" | 464 | "\tfield:%s %s;\toffset:%u;\tsize:%u;\n" |
464 | "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n" | 465 | "\tfield:%s %s;\toffset:%u;\tsize:%u;\n" |
465 | "\n", | 466 | "\n", |
466 | FIELD(unsigned char, type), | 467 | FIELD(unsigned char, type), |
467 | FIELD(unsigned char, flags), | 468 | FIELD(unsigned char, flags), |