linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kajoljain <kjain@linux.ibm.com>
To: cgel.zte@gmail.com, peterz@infradead.org
Cc: mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@redhat.com,
	namhyung@kernel.org, chi.minghao@zte.com.cn,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zeal Robot <zealci@zte.com.cm>
Subject: Re: [PATCH] tools/perf: remove unneeded variable make code cleaner
Date: Fri, 10 Dec 2021 14:41:55 +0530	[thread overview]
Message-ID: <708b524c-2af5-98a1-f56a-4bb4f268de7a@linux.ibm.com> (raw)
In-Reply-To: <20211210022911.424512-1-chi.minghao@zte.com.cn>



On 12/10/21 7:59 AM, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> return value form directly instead of
> taking this in another redundant variable.

Can we reword the commit message stating what and
from where we are removing it. Its not too clear.
Other than that patch looks good to me.

Reviewed-By: Kajol Jain<kjain@linux.ibm.com>

Thanks,
Kajol Jain

> 
> Reported-by: Zeal Robot <zealci@zte.com.cm>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  tools/perf/util/callchain.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
> index 8e2777133bd9..ed30da7e14ab 100644
> --- a/tools/perf/util/callchain.c
> +++ b/tools/perf/util/callchain.c
> @@ -1301,24 +1301,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,
> 

  reply	other threads:[~2021-12-10  9:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10  2:29 [PATCH] tools/perf: remove unneeded variable make code cleaner cgel.zte
2021-12-10  9:11 ` kajoljain [this message]
2021-12-10 10:42   ` Peter Zijlstra
2021-12-10 12:44     ` kajoljain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=708b524c-2af5-98a1-f56a-4bb4f268de7a@linux.ibm.com \
    --to=kjain@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=cgel.zte@gmail.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=zealci@zte.com.cm \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).