From: ye xingchen Date: Tue, 23 Aug 2022 07:56:05 +0000 (+0000) Subject: perf callchain: Remove unneeded 'result' variable X-Git-Tag: v6.6.17~6384^2~125 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=016f2f9821bd5d056d454aefa603f8b4f7d0e0f0;p=platform%2Fkernel%2Flinux-rpi.git perf callchain: Remove unneeded 'result' variable Return the value scnprintf() directly instead of storing it in a redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Cc: Alexandre Truong Cc: Ian Rogers Cc: James Clark Cc: Mark Rutland Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index 7e66367..a093a15 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c @@ -1307,24 +1307,16 @@ int callchain_branch_counts(struct callchain_root *root, static int count_pri64_printf(int idx, const char *str, u64 value, char *bf, int bfsize) { - int printed; - - printed = scnprintf(bf, bfsize, "%s%s:%" PRId64 "", (idx) ? " " : " (", str, value); - - return printed; + return scnprintf(bf, bfsize, "%s%s:%" PRId64 "", (idx) ? " " : " (", str, value); } static int count_float_printf(int idx, const char *str, float value, char *bf, int bfsize, float threshold) { - int printed; - if (threshold != 0.0 && value < threshold) return 0; - printed = scnprintf(bf, bfsize, "%s%s:%.1f%%", (idx) ? " " : " (", str, value); - - return printed; + return scnprintf(bf, bfsize, "%s%s:%.1f%%", (idx) ? " " : " (", str, value); } static int branch_to_str(char *bf, int bfsize,