From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Rishabh Bhatnagar <rishabhb@codeaurora.org>
Subject: [PATCH 3/7] tracing: initcall: Ordered comparison of function pointers
Date: Wed, 02 May 2018 16:00:06 -0400 [thread overview]
Message-ID: <20180502200041.670656386@goodmis.org> (raw)
In-Reply-To: 20180502200003.592877274@goodmis.org
[-- Attachment #1: 0003-tracing-initcall-Ordered-comparison-of-function-poin.patch --]
[-- Type: text/plain, Size: 1785 bytes --]
From: Rishabh Bhatnagar <rishabhb@codeaurora.org>
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>
---
include/trace/events/initcall.h | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/trace/events/initcall.h b/include/trace/events/initcall.h
index 8d6cf10d27c9..eb903c3f195f 100644
--- a/include/trace/events/initcall.h
+++ b/include/trace/events/initcall.h
@@ -31,7 +31,11 @@ TRACE_EVENT(initcall_start,
TP_ARGS(func),
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(
@@ -48,8 +52,12 @@ TRACE_EVENT(initcall_finish,
TP_ARGS(func, ret),
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(
--
2.17.0
next prev parent reply other threads:[~2018-05-02 20:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 20:00 [PATCH 0/7] [GIT PULL] tracing: Some more fixes for 4.17 Steven Rostedt
2018-05-02 20:00 ` [PATCH 1/7] tracing: Fix bad use of igrab in trace_uprobe.c Steven Rostedt
2018-05-02 20:00 ` [PATCH 2/7] tracing: Remove igrab() iput() call from uprobes.c Steven Rostedt
2018-05-02 20:00 ` Steven Rostedt [this message]
2018-05-02 20:00 ` [PATCH 4/7] tracing: Restore proper field flag printing when displaying triggers Steven Rostedt
2018-05-02 20:00 ` [PATCH 5/7] tracing: Add field parsing hist error for hist triggers Steven Rostedt
2018-05-02 20:00 ` [PATCH 6/7] tracing: Add field modifier " Steven Rostedt
2018-05-02 20:00 ` [PATCH 7/7] tracepoint: Do not warn on ENOMEM Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180502200041.670656386@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rishabhb@codeaurora.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox