Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751870AbdIMHrF (ORCPT ); Wed, 13 Sep 2017 03:47:05 -0400 Received: from terminus.zytor.com ([65.50.211.136]:57683 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115AbdIMHrC (ORCPT ); Wed, 13 Sep 2017 03:47:02 -0400 Date: Wed, 13 Sep 2017 00:44:52 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: acme@redhat.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, dsahern@gmail.com, a.p.zijlstra@chello.nl, jolsa@kernel.org Reply-To: hpa@zytor.com, dsahern@gmail.com, mingo@kernel.org, a.p.zijlstra@chello.nl, jolsa@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, namhyung@kernel.org In-Reply-To: <20170908120510.22515-2-jolsa@kernel.org> References: <20170908120510.22515-2-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf ui progress: Make sure we always define step value Git-Commit-ID: 4d286c89e412fc2eaa1b8988481d2f32b5e3826f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1465 Lines: 39 Commit-ID: 4d286c89e412fc2eaa1b8988481d2f32b5e3826f Gitweb: http://git.kernel.org/tip/4d286c89e412fc2eaa1b8988481d2f32b5e3826f Author: Jiri Olsa AuthorDate: Fri, 8 Sep 2017 14:05:07 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 12 Sep 2017 12:34:46 -0300 perf ui progress: Make sure we always define step value Unlikely, but we could have ui_progress__init being called with total < 16, which would set the next and step variables to 0. That would force unnecessary ui_progress__ops->update calls because 'next' would never raise. Forcing the next and step values to be always > 0. Signed-off-by: Jiri Olsa Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20170908120510.22515-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/ui/progress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/ui/progress.c b/tools/perf/ui/progress.c index a0f24c7..a9c1580 100644 --- a/tools/perf/ui/progress.c +++ b/tools/perf/ui/progress.c @@ -25,7 +25,7 @@ void ui_progress__update(struct ui_progress *p, u64 adv) void ui_progress__init(struct ui_progress *p, u64 total, const char *title) { p->curr = 0; - p->next = p->step = total / 16; + p->next = p->step = total / 16 ?: 1; p->total = total; p->title = title;