Linux SNPS ARC Archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARC: perf: Remove redundant initialization of variable idx
@ 2021-11-26 22:23 Colin Ian King
  2021-11-29 10:17 ` Vladimir Isaev
  2021-12-29  3:43 ` Vineet Gupta
  0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2021-11-26 22:23 UTC (permalink / raw
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Vineet Gupta, linux-perf-users, linux-snps-arc
  Cc: kernel-janitors, linux-kernel

The variable idx is being initialized with a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 arch/arc/kernel/perf_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c
index 145722f80c9b..f5dd799ddb9e 100644
--- a/arch/arc/kernel/perf_event.c
+++ b/arch/arc/kernel/perf_event.c
@@ -361,7 +361,7 @@ static int arc_pmu_add(struct perf_event *event, int flags)
 {
 	struct arc_pmu_cpu *pmu_cpu = this_cpu_ptr(&arc_pmu_cpu);
 	struct hw_perf_event *hwc = &event->hw;
-	int idx = hwc->idx;
+	int idx;
 
 	idx = ffz(pmu_cpu->used_mask[0]);
 	if (idx == arc_pmu->n_counters)
-- 
2.33.1


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] ARC: perf: Remove redundant initialization of variable idx
  2021-11-26 22:23 [PATCH] ARC: perf: Remove redundant initialization of variable idx Colin Ian King
@ 2021-11-29 10:17 ` Vladimir Isaev
  2021-12-29  3:43 ` Vineet Gupta
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Isaev @ 2021-11-29 10:17 UTC (permalink / raw
  To: Colin Ian King, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Vineet Gupta,
	linux-perf-users@vger.kernel.org,
	linux-snps-arc@lists.infradead.org
  Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org

On 11/27/21 1:23 AM, Colin Ian King wrote:
>
> The variable idx is being initialized with a value that is never
> read, it is being updated later on. The assignment is redundant and
> can be removed.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  arch/arc/kernel/perf_event.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c
> index 145722f80c9b..f5dd799ddb9e 100644
> --- a/arch/arc/kernel/perf_event.c
> +++ b/arch/arc/kernel/perf_event.c
> @@ -361,7 +361,7 @@ static int arc_pmu_add(struct perf_event *event, int
> flags)
>  {
>  	struct arc_pmu_cpu *pmu_cpu = this_cpu_ptr(&arc_pmu_cpu);
>  	struct hw_perf_event *hwc = &event->hw;
> -	int idx = hwc->idx;
> +	int idx;
> 
>  	idx = ffz(pmu_cpu->used_mask[0]);
>  	if (idx == arc_pmu->n_counters)
> --
> 2.33.1
> 

Acked-by: Vladimir Isaev <isaev@synopsys.com>

Thank you,
Vladimir Isaev

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARC: perf: Remove redundant initialization of variable idx
  2021-11-26 22:23 [PATCH] ARC: perf: Remove redundant initialization of variable idx Colin Ian King
  2021-11-29 10:17 ` Vladimir Isaev
@ 2021-12-29  3:43 ` Vineet Gupta
  1 sibling, 0 replies; 3+ messages in thread
From: Vineet Gupta @ 2021-12-29  3:43 UTC (permalink / raw
  To: Colin Ian King, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Vineet Gupta, linux-perf-users,
	linux-snps-arc
  Cc: kernel-janitors, linux-kernel

On 11/26/21 2:23 PM, Colin Ian King wrote:
> The variable idx is being initialized with a value that is never
> read, it is being updated later on. The assignment is redundant and
> can be removed.
> 
> Signed-off-by: Colin Ian King<colin.i.king@gmail.com>

Sorry for the delay in getting to this. Added to ARC tree now.

Thx,
-Vineet

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-29  3:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-26 22:23 [PATCH] ARC: perf: Remove redundant initialization of variable idx Colin Ian King
2021-11-29 10:17 ` Vladimir Isaev
2021-12-29  3:43 ` Vineet Gupta

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 read-only IMAP folder(s) and NNTP newsgroup(s).