perf print-events: Remove redundant comparison with zero
authorKang Minchul <tegongkang@gmail.com>
Sat, 5 Nov 2022 13:59:32 +0000 (22:59 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 10 Nov 2022 18:39:02 +0000 (15:39 -0300)
Since variable npmus is unsigned int, comparing with 0 is unnecessary.

Signed-off-by: Kang Minchul <tegongkang@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221105135932.81612-1-tegongkang@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/print-events.c

index c4d5d87fae2f6b5bf6aabebafa9e2db9aea420ce..6df947df1c0fcecc6b7e36fa1238c1295fa96f96 100644 (file)
@@ -311,10 +311,8 @@ restart:
                                if ((hybrid_supported == 0) ||
                                    (hybrid_supported == npmus)) {
                                        evt_list[evt_i] = strdup(name);
-                                       if (npmus > 0) {
-                                               for (j = 0; j < npmus; j++)
-                                                       zfree(&evt_pmus[j]);
-                                       }
+                                       for (j = 0; j < npmus; j++)
+                                               zfree(&evt_pmus[j]);
                                } else {
                                        for (j = 0; j < hybrid_supported; j++) {
                                                evt_list[evt_i++] = evt_pmus[j];