Skip to content

Commit e46466b

Browse files
committed
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 <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 8a38cce commit e46466b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/lib/traceevent/event-parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5363,7 +5363,7 @@ int pevent_register_print_function(struct pevent *pevent,
53635363
if (type == PEVENT_FUNC_ARG_VOID)
53645364
break;
53655365

5366-
if (type < 0 || type >= PEVENT_FUNC_ARG_MAX_TYPES) {
5366+
if (type >= PEVENT_FUNC_ARG_MAX_TYPES) {
53675367
do_warning("Invalid argument type %d", type);
53685368
ret = PEVENT_ERRNO__INVALID_ARG_TYPE;
53695369
goto out_free;

0 commit comments

Comments
 (0)