From: Jin Yao Date: Thu, 4 May 2017 14:58:14 +0000 (+0800) Subject: perf report: Remove unnecessary check in annotate_browser_write() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c564f0db92b7f8d734ce530e42a540e12ae3d583;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git perf report: Remove unnecessary check in annotate_browser_write() In annotate_browser_write(), if (dl->offset != -1 && percent_max != 0.0) { if (percent_max != 0.0) { ... } ... } The second check of (percent_max != 0.0) is not necessary, remove it. Signed-off-by: Yao Jin Acked-by: Milian Wolff Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Cc: Yao Jin Link: http://lkml.kernel.org/r/1493909895-9668-2-git-send-email-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index d990ad08a3c6..52c1e8d672b5 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c @@ -132,21 +132,17 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int } if (dl->offset != -1 && percent_max != 0.0) { - if (percent_max != 0.0) { - for (i = 0; i < ab->nr_events; i++) { - ui_browser__set_percent_color(browser, - bdl->samples[i].percent, - current_entry); - if (annotate_browser__opts.show_total_period) { - ui_browser__printf(browser, "%6" PRIu64 " ", - bdl->samples[i].nr); - } else { - ui_browser__printf(browser, "%6.2f ", - bdl->samples[i].percent); - } + for (i = 0; i < ab->nr_events; i++) { + ui_browser__set_percent_color(browser, + bdl->samples[i].percent, + current_entry); + if (annotate_browser__opts.show_total_period) { + ui_browser__printf(browser, "%6" PRIu64 " ", + bdl->samples[i].nr); + } else { + ui_browser__printf(browser, "%6.2f ", + bdl->samples[i].percent); } - } else { - ui_browser__write_nstring(browser, " ", 7 * ab->nr_events); } } else { ui_browser__set_percent_color(browser, 0, current_entry);