All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Colin King <colin.king@canonical.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	linux-pm@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][V2] drivers: thermal: processor_thermal_device: fix missing bitwise-or operators
Date: Mon, 19 Aug 2019 14:32:43 +0800	[thread overview]
Message-ID: <95dce698e7790dac7178e950a6a9dde71d231cae.camel@intel.com> (raw)
In-Reply-To: <42db46c33466a12221e0968e82c4c4ee17b0341d.camel@linux.intel.com>

On Mon, 2019-07-29 at 14:09 -0700, Srinivas Pandruvada wrote:
> On Mon, 2019-07-29 at 13:03 +0100, Colin King wrote:
> > 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 = operators with &=
> > and
> > > = 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>
> 
> Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com
> >

Hi, Colin,

thanks for the fix, as b0c74b08517e ("drivers: thermal:
processor_thermal_device: Export sysfs inteface for TCC offset") has
not been shipped in upstream yet, I will fold this fix into the
original patch directly.

thanks,
rui
> 
> > ---
> > 
> > V2: Add in &= operator missing from V1. Doh.
> > 
> > ---
> >  .../thermal/intel/int340x_thermal/processor_thermal_device.c  | 4
> > ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git
> > a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> > b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> > index 6f6ac6a8e82d..97333fc4be42 100644
> > ---
> > a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> > +++
> > b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> > @@ -163,8 +163,8 @@ static int tcc_offset_update(int tcc)
> >  	if (err)
> >  		return err;
> >  
> > -	val = ~GENMASK_ULL(31, 24);
> > -	val = (tcc & 0xff) << 24;
> > +	val &= ~GENMASK_ULL(31, 24);
> > +	val |= (tcc & 0xff) << 24;
> >  
> >  	err = wrmsrl_safe(MSR_IA32_TEMPERATURE_TARGET, val);
> >  	if (err)
> 
> 


WARNING: multiple messages have this Message-ID (diff)
From: Zhang Rui <rui.zhang@intel.com>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Colin King <colin.king@canonical.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	linux-pm@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][V2] drivers: thermal: processor_thermal_device: fix missing bitwise-or operators
Date: Mon, 19 Aug 2019 06:32:43 +0000	[thread overview]
Message-ID: <95dce698e7790dac7178e950a6a9dde71d231cae.camel@intel.com> (raw)
In-Reply-To: <42db46c33466a12221e0968e82c4c4ee17b0341d.camel@linux.intel.com>

On Mon, 2019-07-29 at 14:09 -0700, Srinivas Pandruvada wrote:
> On Mon, 2019-07-29 at 13:03 +0100, Colin King wrote:
> > 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 = operators with &> > and
> > > = 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>
> 
> Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com
> >

Hi, Colin,

thanks for the fix, as b0c74b08517e ("drivers: thermal:
processor_thermal_device: Export sysfs inteface for TCC offset") has
not been shipped in upstream yet, I will fold this fix into the
original patch directly.

thanks,
rui
> 
> > ---
> > 
> > V2: Add in &= operator missing from V1. Doh.
> > 
> > ---
> >  .../thermal/intel/int340x_thermal/processor_thermal_device.c  | 4
> > ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git
> > a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> > b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> > index 6f6ac6a8e82d..97333fc4be42 100644
> > ---
> > a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> > +++
> > b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> > @@ -163,8 +163,8 @@ static int tcc_offset_update(int tcc)
> >  	if (err)
> >  		return err;
> >  
> > -	val = ~GENMASK_ULL(31, 24);
> > -	val = (tcc & 0xff) << 24;
> > +	val &= ~GENMASK_ULL(31, 24);
> > +	val |= (tcc & 0xff) << 24;
> >  
> >  	err = wrmsrl_safe(MSR_IA32_TEMPERATURE_TARGET, val);
> >  	if (err)
> 
> 

  reply	other threads:[~2019-08-19  6:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29 12:03 [PATCH][V2] drivers: thermal: processor_thermal_device: fix missing bitwise-or operators Colin King
2019-07-29 12:03 ` Colin King
2019-07-29 12:34 ` walter harms
2019-07-29 12:34   ` walter harms
2019-07-29 21:09 ` Srinivas Pandruvada
2019-07-29 21:09   ` Srinivas Pandruvada
2019-08-19  6:32   ` Zhang Rui [this message]
2019-08-19  6:32     ` Zhang Rui

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=95dce698e7790dac7178e950a6a9dde71d231cae.camel@intel.com \
    --to=rui.zhang@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=srinivas.pandruvada@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.