diff mbox

[05/16] thermal: mvebu: Fix valid check for thermal register

Message ID 1363818997-23137-6-git-send-email-ezequiel.garcia@free-electrons.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Ezequiel Garcia March 20, 2013, 10:36 p.m. UTC
The correct value is obtain by first shifting the register by the offset,
later applying the valid mask and finally invert the result.
This check was lacking an extra parenthesis to be strictly correct.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
 drivers/thermal/mvebu_thermal.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Jason Cooper March 21, 2013, 2:35 p.m. UTC | #1
Ezequiel,

On Wed, Mar 20, 2013 at 07:36:26PM -0300, Ezequiel Garcia wrote:
> The correct value is obtain by first shifting the register by the offset,
> later applying the valid mask and finally invert the result.
> This check was lacking an extra parenthesis to be strictly correct.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ---
>  drivers/thermal/mvebu_thermal.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

For the next version of this series, could you please put this fix first
in the series?  In this state, it can't be applied to v3.9-rcX, nor
-stable.

thx,

Jason.
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ezequiel Garcia March 21, 2013, 3:16 p.m. UTC | #2
Hi Jason,

On Thu, Mar 21, 2013 at 10:35:39AM -0400, Jason Cooper wrote:
> On Wed, Mar 20, 2013 at 07:36:26PM -0300, Ezequiel Garcia wrote:
> > The correct value is obtain by first shifting the register by the offset,
> > later applying the valid mask and finally invert the result.
> > This check was lacking an extra parenthesis to be strictly correct.
> > 
> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > ---
> >  drivers/thermal/mvebu_thermal.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> For the next version of this series, could you please put this fix first
> in the series?  In this state, it can't be applied to v3.9-rcX, nor
> -stable.
> 

Given we're still discussing the aproach of this patchset.
I think I prefer to send the fixes now, not as part of the
current series but as independent patches.

What do you think?
Jason Cooper March 21, 2013, 3:24 p.m. UTC | #3
On Thu, Mar 21, 2013 at 12:16:10PM -0300, Ezequiel Garcia wrote:
> Hi Jason,
> 
> On Thu, Mar 21, 2013 at 10:35:39AM -0400, Jason Cooper wrote:
> > On Wed, Mar 20, 2013 at 07:36:26PM -0300, Ezequiel Garcia wrote:
> > > The correct value is obtain by first shifting the register by the offset,
> > > later applying the valid mask and finally invert the result.
> > > This check was lacking an extra parenthesis to be strictly correct.
> > > 
> > > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > > ---
> > >  drivers/thermal/mvebu_thermal.c |    4 ++--
> > >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > For the next version of this series, could you please put this fix first
> > in the series?  In this state, it can't be applied to v3.9-rcX, nor
> > -stable.
> > 
> 
> Given we're still discussing the aproach of this patchset.
> I think I prefer to send the fixes now, not as part of the
> current series but as independent patches.
> 
> What do you think?

I agree.

thx,

Jason.
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ezequiel Garcia March 21, 2013, 7:57 p.m. UTC | #4
On Thu, Mar 21, 2013 at 11:24:00AM -0400, Jason Cooper wrote:
> On Thu, Mar 21, 2013 at 12:16:10PM -0300, Ezequiel Garcia wrote:
> > Hi Jason,
> > 
> > On Thu, Mar 21, 2013 at 10:35:39AM -0400, Jason Cooper wrote:
> > > On Wed, Mar 20, 2013 at 07:36:26PM -0300, Ezequiel Garcia wrote:
> > > > The correct value is obtain by first shifting the register by the offset,
> > > > later applying the valid mask and finally invert the result.
> > > > This check was lacking an extra parenthesis to be strictly correct.
> > > > 
> > > > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > > > ---
> > > >  drivers/thermal/mvebu_thermal.c |    4 ++--
> > > >  1 files changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > For the next version of this series, could you please put this fix first
> > > in the series?  In this state, it can't be applied to v3.9-rcX, nor
> > > -stable.
> > > 
> > 
> > Given we're still discussing the aproach of this patchset.
> > I think I prefer to send the fixes now, not as part of the
> > current series but as independent patches.
> > 
> > What do you think?
> 
> I agree.
> 

I have a question about this though: Who should pick patches for
drivers/thermal/{dove,kirkwood,mvebu} ? You or Zhang?
Jason Cooper March 21, 2013, 8:06 p.m. UTC | #5
On Thu, Mar 21, 2013 at 04:57:09PM -0300, Ezequiel Garcia wrote:
> On Thu, Mar 21, 2013 at 11:24:00AM -0400, Jason Cooper wrote:
> > On Thu, Mar 21, 2013 at 12:16:10PM -0300, Ezequiel Garcia wrote:
> > > Hi Jason,
> > > 
> > > On Thu, Mar 21, 2013 at 10:35:39AM -0400, Jason Cooper wrote:
> > > > On Wed, Mar 20, 2013 at 07:36:26PM -0300, Ezequiel Garcia wrote:
> > > > > The correct value is obtain by first shifting the register by the offset,
> > > > > later applying the valid mask and finally invert the result.
> > > > > This check was lacking an extra parenthesis to be strictly correct.
> > > > > 
> > > > > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > > > > ---
> > > > >  drivers/thermal/mvebu_thermal.c |    4 ++--
> > > > >  1 files changed, 2 insertions(+), 2 deletions(-)
> > > > 
> > > > For the next version of this series, could you please put this fix first
> > > > in the series?  In this state, it can't be applied to v3.9-rcX, nor
> > > > -stable.
> > > > 
> > > 
> > > Given we're still discussing the aproach of this patchset.
> > > I think I prefer to send the fixes now, not as part of the
> > > current series but as independent patches.
> > > 
> > > What do you think?
> > 
> > I agree.
> > 
> 
> I have a question about this though: Who should pick patches for
> drivers/thermal/{dove,kirkwood,mvebu} ? You or Zhang?

That's up to Zhang.  If he has a lot of changes going on this cycle,
he'll probably want to take them through his tree.  However, if he
doesn't, and we have a lot of stuff depending on it (the rest of your
series), he'll probably be ok with Ack'ing it and letting us take it
through our tree.

thx,

Jason.
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/thermal/mvebu_thermal.c b/drivers/thermal/mvebu_thermal.c
index d54f90c..ef04e4e 100644
--- a/drivers/thermal/mvebu_thermal.c
+++ b/drivers/thermal/mvebu_thermal.c
@@ -41,8 +41,8 @@  static int mvebu_get_temp(struct thermal_zone_device *thermal,
 	reg = readl_relaxed(priv->sensor);
 
 	/* Valid check */
-	if (!(reg >> KIRKWOOD_THERMAL_VALID_OFFSET) &
-	    KIRKWOOD_THERMAL_VALID_MASK) {
+	if (!((reg >> KIRKWOOD_THERMAL_VALID_OFFSET) &
+	    KIRKWOOD_THERMAL_VALID_MASK)) {
 		dev_err(&thermal->device,
 			"Temperature sensor reading not valid\n");
 		return -EIO;