2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 12:14:01 +08:00

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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
This commit is contained in:
Steven Rostedt 2009-03-10 10:14:35 -04:00
parent 157587d7ac
commit ce8eb2bf05

View File

@ -338,8 +338,7 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
#undef FIELD
#define FIELD(type, name) \
#type, #name, (unsigned int)offsetof(typeof(field), name), \
(unsigned int)sizeof(field.name)
#type, #name, offsetof(typeof(field), name), sizeof(field.name)
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 */
return trace_seq_printf(s,
"\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"
"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
"\n",
FIELD(unsigned char, type),
FIELD(unsigned char, flags),