[tip: x86/cleanups] x86/smp: Remove unnecessary assignment to local var freq_scale

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     85784470efa2d5733e86679ba05d310ece81b20f
Gitweb:        https://git.kernel.org/tip/85784470efa2d5733e86679ba05d310ece81b20f
Author:        Tim Gardner <tim.gardner@xxxxxxxxxxxxx>
AuthorDate:    Fri, 10 Sep 2021 12:44:05 -06:00
Committer:     Borislav Petkov <bp@xxxxxxx>
CommitterDate: Fri, 17 Sep 2021 21:20:34 +02:00

x86/smp: Remove unnecessary assignment to local var freq_scale

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:

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

Remove the variable initializer.

Signed-off-by: Tim Gardner <tim.gardner@xxxxxxxxxxxxx>
Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Reviewed-by: Giovanni Gherdovich <ggherdovich@xxxxxxx>
Link: https://lkml.kernel.org/r/20210910184405.24422-1-tim.gardner@xxxxxxxxxxxxx
---
 arch/x86/kernel/smpboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 85f6e24..c453b82 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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;
 



[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux