提交 87893689 编写于 作者: L Leo Yan 提交者: Zheng Zengkai

perf c2c: Fix argument type for percent()

mainline inclusion
from mainline-v5.12-rc1
commit 111c1415
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4NGPV
CVE: NA

-------------------------------------------------

For percent() its arguments are defined as integers; this is not
consistent with its consumers which pass u32 arguments.

Thus this patch makes argument type as u32 for percent().
Signed-off-by: NLeo Yan <leo.yan@linaro.org>
Acked-by: NNamhyung Kim <namhyung@kernel.org>
Acked-by: NJiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210114154646.209024-5-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: NWei Li <liwei391@huawei.com>
Reviewed-by: NYang Jihong <yangjihong1@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 0a2ae963
...@@ -876,7 +876,7 @@ static struct c2c_stats *total_stats(struct hist_entry *he) ...@@ -876,7 +876,7 @@ static struct c2c_stats *total_stats(struct hist_entry *he)
return &hists->stats; return &hists->stats;
} }
static double percent(int st, int tot) static double percent(u32 st, u32 tot)
{ {
return tot ? 100. * (double) st / (double) tot : 0; return tot ? 100. * (double) st / (double) tot : 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册