* [PATCH] perf sched: simplify if-if to if-else
@ 2022-04-24 9:07 Wan Jiabing
2022-04-25 0:01 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 2+ messages in thread
From: Wan Jiabing @ 2022-04-24 9:07 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
linux-perf-users, linux-kernel
Cc: kael_w, Wan Jiabing
Use if and else instead of if(A) and if (!A).
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
tools/perf/builtin-sched.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 646bd938927a..66f8e9318123 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -3070,8 +3070,7 @@ static int perf_sched__timehist(struct perf_sched *sched)
/* summary_only implies summary option, but don't overwrite summary if set */
if (sched->summary_only)
sched->summary = sched->summary_only;
-
- if (!sched->summary_only)
+ else
timehist_header(sched);
err = perf_session__process_events(session);
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] perf sched: simplify if-if to if-else
2022-04-24 9:07 [PATCH] perf sched: simplify if-if to if-else Wan Jiabing
@ 2022-04-25 0:01 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-04-25 0:01 UTC (permalink / raw)
To: Wan Jiabing
Cc: Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Jiri Olsa, Namhyung Kim, linux-perf-users, linux-kernel, kael_w
Em Sun, Apr 24, 2022 at 05:07:27PM +0800, Wan Jiabing escreveu:
> Use if and else instead of if(A) and if (!A).
I'm now looking for a brown paper bag... There is some hope, but I'm not
in a mood, will check tomorrow, but certainly this should go in, thanks!
- Arnaldo
> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
> ---
> tools/perf/builtin-sched.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 646bd938927a..66f8e9318123 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -3070,8 +3070,7 @@ static int perf_sched__timehist(struct perf_sched *sched)
> /* summary_only implies summary option, but don't overwrite summary if set */
> if (sched->summary_only)
> sched->summary = sched->summary_only;
> -
> - if (!sched->summary_only)
> + else
> timehist_header(sched);
>
> err = perf_session__process_events(session);
> --
> 2.35.1
--
- Arnaldo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-25 0:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24 9:07 [PATCH] perf sched: simplify if-if to if-else Wan Jiabing
2022-04-25 0:01 ` Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).