Skip to content

Commit

Permalink
x86/smp: Remove unnecessary assignment to local var freq_scale
Browse files Browse the repository at this point in the history
Coverity warns of an unused value in arch_scale_freq_tick():

  CID 100778 (#1 of 1): Unused value (UNUSED_VALUE)
  assigned_value: Assigning value 1024ULL to freq_scale here, but that stored
  value is overwritten before it can be used.

It was introduced by commit:

  e2b0d61 ("x86, sched: check for counters overflow in frequency invariant accounting")

Remove the variable initializer.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Giovanni Gherdovich <ggherdovich@suse.cz>
Link: https://lkml.kernel.org/r/20210910184405.24422-1-tim.gardner@canonical.com
  • Loading branch information
rtg-canonical authored and suryasaimadhu committed Sep 17, 2021
1 parent 6880fa6 commit 8578447
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,7 @@ DEFINE_PER_CPU(unsigned long, arch_freq_scale) = SCHED_CAPACITY_SCALE;

void arch_scale_freq_tick(void)
{
u64 freq_scale = SCHED_CAPACITY_SCALE;
u64 freq_scale;
u64 aperf, mperf;
u64 acnt, mcnt;

Expand Down

0 comments on commit 8578447

Please sign in to comment.