All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools: Simplify the calculation of variables
@ 2021-02-05  3:54 Jiapeng Chong
  2021-02-05  9:49 ` Jiri Olsa
  0 siblings, 1 reply; 3+ messages in thread
From: Jiapeng Chong @ 2021-02-05  3:54 UTC (permalink / raw)
  To: peterz
  Cc: acme, mark.rutland, alexander.shishkin, jolsa, namhyung, ast,
	daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
	kpsingh, linux-kernel, netdev, bpf, Jiapeng Chong

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>
---
 tools/perf/util/header.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index c4ed3dc..4fe9e2a 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -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;
 	}
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf tools: Simplify the calculation of variables
  2021-02-05  3:54 [PATCH] perf tools: Simplify the calculation of variables Jiapeng Chong
@ 2021-02-05  9:49 ` Jiri Olsa
  2021-02-18 13:14   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Olsa @ 2021-02-05  9:49 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: peterz, acme, mark.rutland, alexander.shishkin, namhyung, ast,
	daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
	kpsingh, linux-kernel, netdev, bpf

On Fri, Feb 05, 2021 at 11:54:15AM +0800, Jiapeng Chong wrote:
> 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>
> ---
>  tools/perf/util/header.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
> index c4ed3dc..4fe9e2a 100644
> --- a/tools/perf/util/header.c
> +++ b/tools/perf/util/header.c
> @@ -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

Acked-by: Jiri Olsa <jolsa@redhat.com>

jirka

>  		data->is_pipe = true;
>  		return err;
>  	}
> -- 
> 1.8.3.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf tools: Simplify the calculation of variables
  2021-02-05  9:49 ` Jiri Olsa
@ 2021-02-18 13:14   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-02-18 13:14 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Jiapeng Chong, peterz, mark.rutland, alexander.shishkin, namhyung,
	ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
	kpsingh, linux-kernel, netdev, bpf

Em Fri, Feb 05, 2021 at 10:49:15AM +0100, Jiri Olsa escreveu:
> On Fri, Feb 05, 2021 at 11:54:15AM +0800, Jiapeng Chong wrote:
> > 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>
> > ---
> >  tools/perf/util/header.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
> > index c4ed3dc..4fe9e2a 100644
> > --- a/tools/perf/util/header.c
> > +++ b/tools/perf/util/header.c
> > @@ -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
> 
> Acked-by: Jiri Olsa <jolsa@redhat.com>

Thanks, applied.

- Arnaldo

 
> jirka
> 
> >  		data->is_pipe = true;
> >  		return err;
> >  	}
> > -- 
> > 1.8.3.1
> > 
> 

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-18 16:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-05  3:54 [PATCH] perf tools: Simplify the calculation of variables Jiapeng Chong
2021-02-05  9:49 ` Jiri Olsa
2021-02-18 13:14   ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.