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>
This commit is contained in:
@@ -18,11 +18,11 @@
|
||||
#include "trace_format.h"
|
||||
|
||||
#undef TRACE_FIELD_ZERO_CHAR
|
||||
#define TRACE_FIELD_ZERO_CHAR(item) \
|
||||
ret = trace_seq_printf(s, "\tfield: char " #item ";\t" \
|
||||
"offset:%lu;\tsize:0;\n", \
|
||||
offsetof(typeof(field), item)); \
|
||||
if (!ret) \
|
||||
#define TRACE_FIELD_ZERO_CHAR(item) \
|
||||
ret = trace_seq_printf(s, "\tfield: char " #item ";\t" \
|
||||
"offset:%u;\tsize:0;\n", \
|
||||
(unsigned int)offsetof(typeof(field), item)); \
|
||||
if (!ret) \
|
||||
return 0;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user