Message ID | 20211126222312.1125594-1-colin.i.king@gmail.com |
---|---|
State | New |
Headers | show |
Series | ARC: perf: Remove redundant initialization of variable idx | expand |
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
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
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)
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(-)