mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Giovanni Gherdovich <ggherdovich@suse.cz>
To: Tim Gardner <tim.gardner@canonical.com>, x86@kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Alison Schofield <alison.schofield@intel.com>,
	Nathan Fontenot <nathan.fontenot@amd.com>,
	Balbir Singh <sblbir@amazon.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/smp: Unused value freq_scale
Date: Wed, 15 Sep 2021 09:12:34 +0200	[thread overview]
Message-ID: <7af6051cfc0a40a2461cfaa645cff3dd885d8671.camel@suse.cz> (raw)
In-Reply-To: <20210910184405.24422-1-tim.gardner@canonical.com>

On Fri, 2021-09-10 at 12:44 -0600, Tim Gardner wrote:
> 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.
> 
> e2b0d619b400a ("x86, sched: check for counters overflow in frequency invariant
> accounting") introduced this warning.
> 
> Fix this by removing the variable initializer.
> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: x86@kernel.org
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
> Cc: Giovanni Gherdovich <ggherdovich@suse.cz>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
> Cc: Alison Schofield <alison.schofield@intel.com>
> Cc: Nathan Fontenot <nathan.fontenot@amd.com>
> Cc: Balbir Singh <sblbir@amazon.com>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>  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 85f6e242b6b4..c453b825a57f 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;
>  

Reviewed-by: Giovanni Gherdovich <ggherdovich@suse.cz>


Thanks,
Giovanni


  reply	other threads:[~2021-09-15  7:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 18:44 Tim Gardner
2021-09-15  7:12 ` Giovanni Gherdovich [this message]
2021-09-17 19:27 ` [tip: x86/cleanups] x86/smp: Remove unnecessary assignment to local var freq_scale tip-bot2 for Tim Gardner

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=7af6051cfc0a40a2461cfaa645cff3dd885d8671.camel@suse.cz \
    --to=ggherdovich@suse.cz \
    --cc=alison.schofield@intel.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nathan.fontenot@amd.com \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sblbir@amazon.com \
    --cc=tglx@linutronix.de \
    --cc=tim.gardner@canonical.com \
    --cc=vkuznets@redhat.com \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®