diff options
author | Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 2008-03-04 17:29:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-04 19:35:14 -0500 |
commit | acc4988bcf38f9618886eaeb9802aeacc6978ec2 (patch) | |
tree | 7056c977e8db45f475b4034b5cb299aec37d42a2 /include | |
parent | 544adb41077a10d299a1094f12ec55a5843a9bdb (diff) |
markers: add an if(0) to __mark_check_format()
Wrap __mark_check_format() into an if(0) to make sure that parameters such as
trace_mark(mm_page_alloc, "order %u pfn %lu", order, page?page_to_pfn(page):0);
(where page_to_pfn() has side-effects) won't generate code because of the
__mark_check_format().
Thanks to Jan Kiszka for reporting this.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "Frank Ch. Eigler" <fche@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/marker.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/marker.h b/include/linux/marker.h index 5df879dc3776..430f6adf9762 100644 --- a/include/linux/marker.h +++ b/include/linux/marker.h | |||
@@ -104,10 +104,16 @@ static inline void marker_update_probe_range(struct marker *begin, | |||
104 | #define MARK_NOARGS " " | 104 | #define MARK_NOARGS " " |
105 | 105 | ||
106 | /* To be used for string format validity checking with gcc */ | 106 | /* To be used for string format validity checking with gcc */ |
107 | static inline void __printf(1, 2) __mark_check_format(const char *fmt, ...) | 107 | static inline void __printf(1, 2) ___mark_check_format(const char *fmt, ...) |
108 | { | 108 | { |
109 | } | 109 | } |
110 | 110 | ||
111 | #define __mark_check_format(format, args...) \ | ||
112 | do { \ | ||
113 | if (0) \ | ||
114 | ___mark_check_format(format, ## args); \ | ||
115 | } while (0) | ||
116 | |||
111 | extern marker_probe_func __mark_empty_function; | 117 | extern marker_probe_func __mark_empty_function; |
112 | 118 | ||
113 | extern void marker_probe_cb(const struct marker *mdata, | 119 | extern void marker_probe_cb(const struct marker *mdata, |