ftrace.h: TP_fast_assign - use do {} while (0);
PATCH 1/1 ftrace.h: TP_fast_assign - use do {} while (0);
Perhaps this is a more kernel style standard way to allow local variables in TP_fast_assign.
Signed-off-by Joe Perches <[email protected]>
include/trace/ftrace.h +1 -1
@@ -142,7 +142,7 @@ #define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args)#undef TP_fast_assign -#define TP_fast_assign(args...) args +#define TP_fast_assign(args...) do { args } while (0);#undef TP_perf_assign #define TP_perf_assign(args...)
Steven Rostedt
maintainerQuoted 12 lines · Joe Perches
Perhaps this is a more kernel style standard way to allow local variables in
TP_fast_assign.Signed-off-by Joe Perches <[email protected]>include/trace/ftrace.h +0
-0
include/trace/ftrace.h line 148
Quoted 8 lines
include/trace/ftrace.h +1
-1@@ -142,7 +142,7 @@ #define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args)#undef TP_fast_assign -#define TP_fast_assign(args...) args +#define TP_fast_assign(args...) do { args } while (0);#undef TP_perf_assign #define TP_perf_assign(args...)
This is not a normal macro that is used globally. I like the referenced commit better, because it shows where it is used what is happening. Note, TP_fast_assign is just a parameter into another macro, and using do { } while (0) is not really going to help change anything. This doesn't even remove a checkpatch warning.
-- Steve