* [PATCH for 3.9] thermal: mvebu: Fix valid check for thermal register
@ 2013-03-21 20:42 Ezequiel Garcia
2013-03-26 14:24 ` Zhang Rui
0 siblings, 1 reply; 2+ messages in thread
From: Ezequiel Garcia @ 2013-03-21 20:42 UTC (permalink / raw)
To: linux-arm-kernel, linux-pm
Cc: Jason Cooper, Zhang Rui, Andrew Lunn, Nobuhiro Iwamatsu,
Thomas Petazzoni, Gregory Clement, Lior Amsalem, Ezequiel Garcia
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>
---
I've taken this fix out of the thermal patchset,
so we can apply it earlier on v3.9.
drivers/thermal/kirkwood_thermal.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
index 65cb4f0..ee433b7 100644
--- a/drivers/thermal/kirkwood_thermal.c
+++ b/drivers/thermal/kirkwood_thermal.c
@@ -41,8 +41,8 @@ static int kirkwood_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;
--
1.7.8.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH for 3.9] thermal: mvebu: Fix valid check for thermal register
2013-03-21 20:42 [PATCH for 3.9] thermal: mvebu: Fix valid check for thermal register Ezequiel Garcia
@ 2013-03-26 14:24 ` Zhang Rui
0 siblings, 0 replies; 2+ messages in thread
From: Zhang Rui @ 2013-03-26 14:24 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: linux-arm-kernel, linux-pm, Jason Cooper, Andrew Lunn,
Nobuhiro Iwamatsu, Thomas Petazzoni, Gregory Clement,
Lior Amsalem
On Thu, 2013-03-21 at 17:42 -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>
applied to thermal -next.
thanks,
rui
> ---
> I've taken this fix out of the thermal patchset,
> so we can apply it earlier on v3.9.
>
> drivers/thermal/kirkwood_thermal.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
> index 65cb4f0..ee433b7 100644
> --- a/drivers/thermal/kirkwood_thermal.c
> +++ b/drivers/thermal/kirkwood_thermal.c
> @@ -41,8 +41,8 @@ static int kirkwood_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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-26 14:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 20:42 [PATCH for 3.9] thermal: mvebu: Fix valid check for thermal register Ezequiel Garcia
2013-03-26 14:24 ` Zhang Rui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).