From: Peter Zijlstra <peterz@infradead.org>
To: zengjx95@gmail.com
Cc: mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, vschneid@redhat.com,
linux-kernel@vger.kernel.org,
Zeng Jingxiang <linuszeng@tencent.com>
Subject: Re: [PATCH] kernel/sched/cputime: Fix unused value in cputime_adjust()
Date: Wed, 20 Jul 2022 13:33:28 +0200 [thread overview]
Message-ID: <YtfoCAKfV8PXQz5h@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20220720102956.1141634-1-zengjx95@gmail.com>
On Wed, Jul 20, 2022 at 06:29:56PM +0800, zengjx95@gmail.com wrote:
> From: Zeng Jingxiang <linuszeng@tencent.com>
>
> Coverity warns uf an unused value:
>
> assigned_value: Assign the value of the variable rtime to utime here,
> but that stored value is overwritten before it can be used.
> 568 if (stime == 0) {
> 569 utime = rtime;
> 570 goto update;
> 571 }
>
> value_overwrite: Overwriting previous write to utime with
> the value of expression rtime - stime.
> 592 utime = rtime - stime;
Coverity is being daft, the compiler has a dead-store-elimination pass.
This way the code is more consistent / easier to ready.
next prev parent reply other threads:[~2022-07-20 11:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 10:29 zengjx95
2022-07-20 11:33 ` Peter Zijlstra [this message]
2022-07-20 12:25 ` jingxiang zeng
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=YtfoCAKfV8PXQz5h@worktop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linuszeng@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=zengjx95@gmail.com \
/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®