[bvanassche:tracing 2/2] include/linux/compiler.h:246:47: error: ordered comparison of pointer with null pointer

From: kernel test robot
Date: Thu Aug 25 2022 - 09:16:06 EST


tree: https://github.com/bvanassche/linux tracing
head: e50691460d5ea5a49b903e0ea50276e942b6f34f
commit: e50691460d5ea5a49b903e0ea50276e942b6f34f [2/2] tracing: Define is_signed_type() once
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220825/202208252159.T4WiCecR-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/bvanassche/linux/commit/e50691460d5ea5a49b903e0ea50276e942b6f34f
git remote add bvanassche https://github.com/bvanassche/linux
git fetch --no-tags bvanassche tracing
git checkout e50691460d5ea5a49b903e0ea50276e942b6f34f
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from include/trace/define_trace.h:102,
from drivers/gpu/drm/i915/gvt/trace.h:383,
from drivers/gpu/drm/i915/gvt/trace_points.c:33:
>> include/linux/compiler.h:246:47: error: ordered comparison of pointer with null pointer [-Werror=extra]
246 | #define is_signed_type(type) (((type)(-1)) <= (type)0)
| ^~
include/trace/trace_events.h:244:9: note: in definition of macro 'DECLARE_EVENT_CLASS'
244 | tstruct \
| ^~~~~~~
include/trace/trace_events.h:43:30: note: in expansion of macro 'PARAMS'
43 | PARAMS(tstruct), \
| ^~~~~~
include/trace/../../drivers/gpu/drm/i915/gvt/trace.h:42:1: note: in expansion of macro 'TRACE_EVENT'
42 | TRACE_EVENT(spt_alloc,
| ^~~~~~~~~~~
include/trace/../../drivers/gpu/drm/i915/gvt/trace.h:48:9: note: in expansion of macro 'TP_STRUCT__entry'
48 | TP_STRUCT__entry(
| ^~~~~~~~~~~~~~~~
include/trace/stages/stage4_event_fields.h:11:22: note: in expansion of macro 'is_signed_type'
11 | .is_signed = is_signed_type(_type), .filter_type = _filter_type },
| ^~~~~~~~~~~~~~
include/trace/stages/stage4_event_fields.h:20:33: note: in expansion of macro '__field_ext'
20 | #define __field(type, item) __field_ext(type, item, FILTER_OTHER)
| ^~~~~~~~~~~
include/trace/../../drivers/gpu/drm/i915/gvt/trace.h:50:17: note: in expansion of macro '__field'
50 | __field(void *, spt)
| ^~~~~~~
>> include/linux/compiler.h:246:47: error: ordered comparison of pointer with null pointer [-Werror=extra]
246 | #define is_signed_type(type) (((type)(-1)) <= (type)0)
| ^~
include/trace/trace_events.h:244:9: note: in definition of macro 'DECLARE_EVENT_CLASS'
244 | tstruct \
| ^~~~~~~
include/trace/trace_events.h:43:30: note: in expansion of macro 'PARAMS'
43 | PARAMS(tstruct), \
| ^~~~~~
include/trace/../../drivers/gpu/drm/i915/gvt/trace.h:72:1: note: in expansion of macro 'TRACE_EVENT'
72 | TRACE_EVENT(spt_free,
| ^~~~~~~~~~~
include/trace/../../drivers/gpu/drm/i915/gvt/trace.h:77:9: note: in expansion of macro 'TP_STRUCT__entry'
77 | TP_STRUCT__entry(
| ^~~~~~~~~~~~~~~~
include/trace/stages/stage4_event_fields.h:11:22: note: in expansion of macro 'is_signed_type'
11 | .is_signed = is_signed_type(_type), .filter_type = _filter_type },
| ^~~~~~~~~~~~~~
include/trace/stages/stage4_event_fields.h:20:33: note: in expansion of macro '__field_ext'
20 | #define __field(type, item) __field_ext(type, item, FILTER_OTHER)
| ^~~~~~~~~~~
include/trace/../../drivers/gpu/drm/i915/gvt/trace.h:79:17: note: in expansion of macro '__field'
79 | __field(void *, spt)
| ^~~~~~~
>> include/linux/compiler.h:246:47: error: ordered comparison of pointer with null pointer [-Werror=extra]
246 | #define is_signed_type(type) (((type)(-1)) <= (type)0)
| ^~
include/trace/trace_events.h:244:9: note: in definition of macro 'DECLARE_EVENT_CLASS'
244 | tstruct \
| ^~~~~~~
include/trace/trace_events.h:43:30: note: in expansion of macro 'PARAMS'
43 | PARAMS(tstruct), \
| ^~~~~~
include/trace/../../drivers/gpu/drm/i915/gvt/trace.h:228:1: note: in expansion of macro 'TRACE_EVENT'
228 | TRACE_EVENT(gvt_command,
| ^~~~~~~~~~~
include/trace/../../drivers/gpu/drm/i915/gvt/trace.h:236:9: note: in expansion of macro 'TP_STRUCT__entry'
236 | TP_STRUCT__entry(
| ^~~~~~~~~~~~~~~~
include/trace/stages/stage4_event_fields.h:11:22: note: in expansion of macro 'is_signed_type'
11 | .is_signed = is_signed_type(_type), .filter_type = _filter_type },
| ^~~~~~~~~~~~~~
include/trace/stages/stage4_event_fields.h:20:33: note: in expansion of macro '__field_ext'
20 | #define __field(type, item) __field_ext(type, item, FILTER_OTHER)
| ^~~~~~~~~~~
include/trace/../../drivers/gpu/drm/i915/gvt/trace.h:243:17: note: in expansion of macro '__field'
243 | __field(void*, workload)
| ^~~~~~~
cc1: all warnings being treated as errors


vim +246 include/linux/compiler.h

241
242 /*
243 * Whether 'type' is a signed type or an unsigned type. Supports scalar types,
244 * bool and also pointer types.
245 */
> 246 #define is_signed_type(type) (((type)(-1)) <= (type)0)
247

--
0-DAY CI Kernel Test Service
https://01.org/lkp