perf tools: Simplify the calculation of variables
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Fri, 5 Feb 2021 03:54:15 +0000 (11:54 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 18 Feb 2021 13:13:37 +0000 (10:13 -0300)
Fix the following coccicheck warnings:

./tools/perf/util/header.c:3809:18-20: WARNING !A || A && B is
equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: bpf@vger.kernel.org
Cc: netdev@vger.kernel.org
Link: http://lore.kernel.org/lkml/1612497255-87189-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/header.c

index c4ed3dc..4fe9e2a 100644 (file)
@@ -3806,7 +3806,7 @@ int perf_session__read_header(struct perf_session *session)
         * check for the pipe header regardless of source.
         */
        err = perf_header__read_pipe(session);
-       if (!err || (err && perf_data__is_pipe(data))) {
+       if (!err || perf_data__is_pipe(data)) {
                data->is_pipe = true;
                return err;
        }