Commit ce8eb2bf authored by Steven Rostedt's avatar Steven Rostedt

tracing: fix printk format specifier

Impact: clean up

The offsetof and sizeof are of type size_t, and instead of typecasting
them to unsigned int for printk formatting, one could just use %zu.
Reported-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
parent 157587d7
...@@ -338,8 +338,7 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt, ...@@ -338,8 +338,7 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
#undef FIELD #undef FIELD
#define FIELD(type, name) \ #define FIELD(type, name) \
#type, #name, (unsigned int)offsetof(typeof(field), name), \ #type, #name, offsetof(typeof(field), name), sizeof(field.name)
(unsigned int)sizeof(field.name)
static int trace_write_header(struct trace_seq *s) static int trace_write_header(struct trace_seq *s)
{ {
...@@ -347,11 +346,11 @@ static int trace_write_header(struct trace_seq *s) ...@@ -347,11 +346,11 @@ static int trace_write_header(struct trace_seq *s)
/* struct trace_entry */ /* struct trace_entry */
return trace_seq_printf(s, return trace_seq_printf(s,
"\tfield:%s %s;\toffset:%u;\tsize:%u;\n" "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\tfield:%s %s;\toffset:%u;\tsize:%u;\n" "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\tfield:%s %s;\toffset:%u;\tsize:%u;\n" "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\tfield:%s %s;\toffset:%u;\tsize:%u;\n" "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\tfield:%s %s;\toffset:%u;\tsize:%u;\n" "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\n", "\n",
FIELD(unsigned char, type), FIELD(unsigned char, type),
FIELD(unsigned char, flags), FIELD(unsigned char, flags),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment