Skip to contentSkip to conversation

perf tools: Simplify the calculation of variables

PATCH Applied Jiapeng Chong 3 participants 3 messages Feb 5, 2021 – Feb 18, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf tools: Simplify the calculation of variables

Fix the following coccicheck warnings:

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

---
 tools/perf/util/header.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/header.c +1 -1
index c4ed3dc..4fe9e2a 100644
@@ -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;
 	}
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · Jiapeng Chong

Fix the following coccicheck warnings:

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

---
 tools/perf/util/header.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/header.c +0 -0
index c4ed3dc..4fe9e2a 100644

tools/perf/util/header.c int perf_session__read_header(struct perf_session *session) · line 3809

Quoted 5 lines
tools/perf/util/header.c +1 -1
@@ -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)) {

mama mia, thanks

jirka

Quoted 6 lines
tools/perf/util/header.c +0 -0
 		data->is_pipe = true;
 		return err;
 	}
Signature · 1 line
1.8.3.1
maintainer Applied
#2 lore raw

Em Fri, Feb 05, 2021 at 10:49:15AM +0100, Jiri Olsa escreveu:

Quoted 25 lines · Jiapeng Chong
Quoted 16 lines

Fix the following coccicheck warnings:

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

---
 tools/perf/util/header.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/header.c +0 -0
index c4ed3dc..4fe9e2a 100644

tools/perf/util/header.c int perf_session__read_header(struct perf_session *session) · line 3809

Quoted 5 lines
tools/perf/util/header.c +1 -1
@@ -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)) {

mama mia, thanks

Quoted 1 line

Thanks, applied.

- Arnaldo

Quoted 9 lines

jirka

Quoted 6 lines
tools/perf/util/header.c +0 -0
 		data->is_pipe = true;
 		return err;
 	}
Signature · 1 line
1.8.3.1
Signature · 1 line
- Arnaldo