[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190712085908.4146364-1-arnd@arndb.de>
Date: Fri, 12 Jul 2019 10:58:48 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Mike Rapoport <rppt@...ux.ibm.com>,
Petr Mladek <pmladek@...e.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com
Subject: [PATCH] xen/trace: avoid clang warning on function pointers
clang-9 does not like the way that the is_signed_type() compares
function pointers deep inside of the trace even macros:
In file included from arch/x86/xen/trace.c:21:
In file included from include/trace/events/xen.h:475:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:467:
include/trace/events/xen.h:69:7: error: ordered comparison of function pointers ('xen_mc_callback_fn_t' (aka 'void (*)(void *)') and 'xen_mc_callback_fn_t') [-Werror,-Wordered-compare-function-pointers]
__field(xen_mc_callback_fn_t, fn)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/trace/trace_events.h:415:29: note: expanded from macro '__field'
#define __field(type, item) __field_ext(type, item, FILTER_OTHER)
^
include/trace/trace_events.h:401:6: note: expanded from macro '__field_ext'
is_signed_type(type), filter_type); \
^
include/linux/trace_events.h:540:44: note: expanded from macro 'is_signed_type'
#define is_signed_type(type) (((type)(-1)) < (type)1)
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/trace/trace_events.h:77:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(tstruct), \
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/tracepoint.h:95:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^
include/trace/trace_events.h:455:2: note: expanded from macro 'DECLARE_EVENT_CLASS'
tstruct; \
^~~~~~~
I guess the warning is reasonable in principle, though this seems to
be the only instance we get in the entire kernel today.
Shut up the warning by making it a void pointer in the exported
structure.
Fixes: c796f213a693 ("xen/trace: add multicall tracing")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
include/trace/events/xen.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h
index 9a0e8af21310..f75b77414ac1 100644
--- a/include/trace/events/xen.h
+++ b/include/trace/events/xen.h
@@ -66,7 +66,7 @@ TRACE_EVENT(xen_mc_callback,
TP_PROTO(xen_mc_callback_fn_t fn, void *data),
TP_ARGS(fn, data),
TP_STRUCT__entry(
- __field(xen_mc_callback_fn_t, fn)
+ __field(void *, fn)
__field(void *, data)
),
TP_fast_assign(
--
2.20.0
Powered by blists - more mailing lists