Skip to content

Commit 0566e40

Browse files
Rishabh Bhatnagarrostedt
authored andcommitted
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.org Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> [ Added comment to why we are using field_struct() ] Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 61f9420 commit 0566e40

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎include/trace/events/initcall.h‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ TRACE_EVENT(initcall_start,
3131
TP_ARGS(func),
3232

3333
TP_STRUCT__entry(
34-
__field(initcall_t, func)
34+
/*
35+
* Use field_struct to avoid is_signed_type()
36+
* comparison of a function pointer
37+
*/
38+
__field_struct(initcall_t, func)
3539
),
3640

3741
TP_fast_assign(
@@ -48,8 +52,12 @@ TRACE_EVENT(initcall_finish,
4852
TP_ARGS(func, ret),
4953

5054
TP_STRUCT__entry(
51-
__field(initcall_t, func)
52-
__field(int, ret)
55+
/*
56+
* Use field_struct to avoid is_signed_type()
57+
* comparison of a function pointer
58+
*/
59+
__field_struct(initcall_t, func)
60+
__field(int, ret)
5361
),
5462

5563
TP_fast_assign(

0 commit comments

Comments
 (0)