提交 0566e40c 编写于 作者: R Rishabh Bhatnagar 提交者: Steven Rostedt (VMware)

tracing: initcall: Ordered comparison of function pointers

Using initcall_t in the __field macro generates the following warning
with clang version 6.0:

include/trace/events/initcall.h:34:3: warning: ordered comparison of
function pointers ('initcall_t' (aka 'int (*)(void)') and 'initcall_t')

__field macro expands to __field_ext macro which does is_signed_type
check on the type argument. Since initcall_t is defined as a function
pointer, using it as the type in the __field macro, leads to an ordered
comparison of function pointer warning, inside the check. Using
__field_struct macro avoids the issue.

Link: http://lkml.kernel.org/r/1524699755-29388-1-git-send-email-rishabhb@codeaurora.orgSigned-off-by: NRishabh Bhatnagar <rishabhb@codeaurora.org>
[ Added comment to why we are using field_struct() ]
Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
上级 61f94203
...@@ -31,7 +31,11 @@ TRACE_EVENT(initcall_start, ...@@ -31,7 +31,11 @@ TRACE_EVENT(initcall_start,
TP_ARGS(func), TP_ARGS(func),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(initcall_t, func) /*
* Use field_struct to avoid is_signed_type()
* comparison of a function pointer
*/
__field_struct(initcall_t, func)
), ),
TP_fast_assign( TP_fast_assign(
...@@ -48,8 +52,12 @@ TRACE_EVENT(initcall_finish, ...@@ -48,8 +52,12 @@ TRACE_EVENT(initcall_finish,
TP_ARGS(func, ret), TP_ARGS(func, ret),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(initcall_t, func) /*
__field(int, ret) * Use field_struct to avoid is_signed_type()
* comparison of a function pointer
*/
__field_struct(initcall_t, func)
__field(int, ret)
), ),
TP_fast_assign( TP_fast_assign(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册