From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Colin Ian King <colin.king@canonical.com>, wharms@bfs.de
Cc: Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] drivers: thermal: processor_thermal_device: fix missing bitwise-or operator
Date: Mon, 29 Jul 2019 04:50:40 -0700 [thread overview]
Message-ID: <6be021a31eb9a7976b2347dd3ac3cd7f10c8d71f.camel@linux.intel.com> (raw)
In-Reply-To: <0cfe48bb-d97f-86d3-db4b-fdd864197b69@canonical.com>
On Mon, 2019-07-29 at 12:29 +0100, Colin Ian King wrote:
> On 29/07/2019 12:24, walter harms wrote:
> >
> >
> > Am 29.07.2019 12:29, schrieb Colin King:
> > > From: Colin Ian King <colin.king@canonical.com>
> > >
> > > The variable val is having the top 8 bits cleared and then the
> > > variable
> > > is being re-assinged and setting just the top 8 bits. I believe
> > > the
> > > intention was bitwise-or in the top 8 bits. Fix this by
> > > replacing
> > > the = operator with |= instead.
> > >
> > > Addresses-Coverity: ("Unused value")
> > > Fixes: b0c74b08517e ("drivers: thermal: processor_thermal_device:
> > > Export sysfs inteface for TCC offset")
> > > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > > ---
> > > .../thermal/intel/int340x_thermal/processor_thermal_device.c
> > > | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git
> > > a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.
> > > c
> > > b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.
> > > c
> > > index 6f6ac6a8e82d..cb22317911ef 100644
> > > ---
> > > a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.
> > > c
> > > +++
> > > b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.
> > > c
> > > @@ -164,7 +164,7 @@ static int tcc_offset_update(int tcc)
> > > return err;
> > >
> > > val = ~GENMASK_ULL(31, 24);
> > > - val = (tcc & 0xff) << 24;
> > > + val |= (tcc & 0xff) << 24;
> > >
> >
> > I do not think that GENMASK makes sence here.
>
> Yeah, val &= ~GENMASK_ULL(31, 24)
>
> I'll send a V2
>
Thanks Colin for the fix.
-Srinivas
>
> >
> > re,
> > wh
> >
> > > err = wrmsrl_safe(MSR_IA32_TEMPERATURE_TARGET, val);
> > > if (err)
>
>
prev parent reply other threads:[~2019-07-29 11:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 10:29 [PATCH][next] drivers: thermal: processor_thermal_device: fix missing bitwise-or operator Colin King
2019-07-29 11:24 ` walter harms
2019-07-29 11:29 ` Colin Ian King
2019-07-29 11:50 ` Srinivas Pandruvada [this message]
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=6be021a31eb9a7976b2347dd3ac3cd7f10c8d71f.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=colin.king@canonical.com \
--cc=daniel.lezcano@linaro.org \
--cc=edubezval@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rui.zhang@intel.com \
--cc=wharms@bfs.de \
/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