提交 e46466b8 编写于 作者: A Arnaldo Carvalho de Melo

tools lib traceevent: No need to check for < 0 on an unsigned enum

gcc on f14 32-bit complains:

  tools/lib/traceevent/event-parse.c: In function ‘pevent_register_print_function’:
  tools/lib/traceevent/event-parse.c:5366:3: error: comparison of unsigned expression < 0 is always false

This is because:

          enum pevent_func_arg_type type;

this enum doesn't have any negative value, so gcc makes it an 'unsigned
int'. Fix it by removing the < 0 test.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/n/tip-6vnd6ud6fbpn48zax4a5ru01@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 8a38cce4
...@@ -5363,7 +5363,7 @@ int pevent_register_print_function(struct pevent *pevent, ...@@ -5363,7 +5363,7 @@ int pevent_register_print_function(struct pevent *pevent,
if (type == PEVENT_FUNC_ARG_VOID) if (type == PEVENT_FUNC_ARG_VOID)
break; break;
if (type < 0 || type >= PEVENT_FUNC_ARG_MAX_TYPES) { if (type >= PEVENT_FUNC_ARG_MAX_TYPES) {
do_warning("Invalid argument type %d", type); do_warning("Invalid argument type %d", type);
ret = PEVENT_ERRNO__INVALID_ARG_TYPE; ret = PEVENT_ERRNO__INVALID_ARG_TYPE;
goto out_free; goto out_free;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册