perf utils: Check verbose flag properly

It now can have negative value to suppress the message entirely.  So it
needs to check it being positive.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20170217081742.17417-3-namhyung@kernel.org
[ Adjust fuzz on tools/perf/util/pmu.c, add > 0 checks in many other places ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Namhyung Kim
2017-02-17 17:17:38 +09:00
committed by Arnaldo Carvalho de Melo
parent 80df198820
commit bb963e1650
29 changed files with 52 additions and 52 deletions

View File

@@ -49,7 +49,7 @@ static char *mapfile(const char *fn, size_t *size)
int err;
int fd = open(fn, O_RDONLY);
if (fd < 0 && verbose && fn) {
if (fd < 0 && verbose > 0 && fn) {
pr_err("Error opening events file '%s': %s\n", fn,
strerror(errno));
}