* [PATCH] ftrace.h: TP_fast_assign - use do {} while (0);
@ 2009-09-09 16:48 Joe Perches
2009-09-09 16:58 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2009-09-09 16:48 UTC (permalink / raw)
To: Steven Rostedt, Li Zefan; +Cc: LKML
Perhaps this is a more kernel style standard way to allow
local variables in TP_fast_assign.
http://git.kernel.org/?p=linux/kernel/git/x86/linux-2.6-tip.git;a=commitdiff;h=a9c1c3abe1160a5632e48c929b02b740556bf423
Signed-off-by: Joe Perches <joe@perches.com>
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index f64fbaa..4c99bdc 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -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...)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ftrace.h: TP_fast_assign - use do {} while (0);
2009-09-09 16:48 [PATCH] ftrace.h: TP_fast_assign - use do {} while (0); Joe Perches
@ 2009-09-09 16:58 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2009-09-09 16:58 UTC (permalink / raw)
To: Joe Perches; +Cc: Li Zefan, LKML
On Wed, 2009-09-09 at 09:48 -0700, Joe Perches wrote:
> Perhaps this is a more kernel style standard way to allow
> local variables in TP_fast_assign.
>
> http://git.kernel.org/?p=linux/kernel/git/x86/linux-2.6-tip.git;a=commitdiff;h=a9c1c3abe1160a5632e48c929b02b740556bf423
>
> Signed-off-by: Joe Perches <joe@perches.com>
>
> diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
> index f64fbaa..4c99bdc 100644
> --- a/include/trace/ftrace.h
> +++ b/include/trace/ftrace.h
> @@ -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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-09 16:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-09 16:48 [PATCH] ftrace.h: TP_fast_assign - use do {} while (0); Joe Perches
2009-09-09 16:58 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®