diff mbox series

thermal: armada: fix legacy validity test sense

Message ID E1gL9tG-0003VJ-0s@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Delegated to: Eduardo Valentin
Headers show
Series thermal: armada: fix legacy validity test sense | expand

Commit Message

Russell King (Oracle) Nov. 9, 2018, 4:44 p.m. UTC
Commit 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid()
pointer") removed the unnecessary indirection through a function
pointer, but in doing so, also removed the negation operator too:

-       if (priv->data->is_valid && !priv->data->is_valid(priv)) {
+       if (armada_is_valid(priv)) {

which results in:

armada_thermal f06f808c.thermal: Temperature sensor reading not valid
armada_thermal f2400078.thermal: Temperature sensor reading not valid
armada_thermal f4400078.thermal: Temperature sensor reading not valid

at boot, or whenever the "temp" sysfs file is read.  Replace the
negation operator.

Fixes: 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid() pointer")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/thermal/armada_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Miquel Raynal Nov. 9, 2018, 5:02 p.m. UTC | #1
Hi Russell,

Russell King <rmk+kernel@armlinux.org.uk> wrote on Fri, 09 Nov 2018
16:44:14 +0000:

> Commit 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid()
> pointer") removed the unnecessary indirection through a function
> pointer, but in doing so, also removed the negation operator too:
> 
> -       if (priv->data->is_valid && !priv->data->is_valid(priv)) {
> +       if (armada_is_valid(priv)) {
> 
> which results in:
> 
> armada_thermal f06f808c.thermal: Temperature sensor reading not valid
> armada_thermal f2400078.thermal: Temperature sensor reading not valid
> armada_thermal f4400078.thermal: Temperature sensor reading not valid
> 
> at boot, or whenever the "temp" sysfs file is read.  Replace the
> negation operator.
> 
> Fixes: 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid() pointer")
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/thermal/armada_thermal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
> index 2c2f6d93034e..e16b3cb1808c 100644
> --- a/drivers/thermal/armada_thermal.c
> +++ b/drivers/thermal/armada_thermal.c
> @@ -357,7 +357,7 @@ static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
>  	int ret;
>  
>  	/* Valid check */
> -	if (armada_is_valid(priv)) {
> +	if (!armada_is_valid(priv)) {
>  		dev_err(priv->dev,
>  			"Temperature sensor reading not valid\n");
>  		return -EIO;

Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>


Thanks for fixing this,
Miquèl
Daniel Lezcano Nov. 25, 2018, 10:43 p.m. UTC | #2
On 09/11/2018 17:44, Russell King wrote:
> Commit 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid()
> pointer") removed the unnecessary indirection through a function
> pointer, but in doing so, also removed the negation operator too:
> 
> -       if (priv->data->is_valid && !priv->data->is_valid(priv)) {
> +       if (armada_is_valid(priv)) {
> 
> which results in:
> 
> armada_thermal f06f808c.thermal: Temperature sensor reading not valid
> armada_thermal f2400078.thermal: Temperature sensor reading not valid
> armada_thermal f4400078.thermal: Temperature sensor reading not valid
> 
> at boot, or whenever the "temp" sysfs file is read.  Replace the
> negation operator.
> 
> Fixes: 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid() pointer")
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>

> ---
>  drivers/thermal/armada_thermal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
> index 2c2f6d93034e..e16b3cb1808c 100644
> --- a/drivers/thermal/armada_thermal.c
> +++ b/drivers/thermal/armada_thermal.c
> @@ -357,7 +357,7 @@ static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
>  	int ret;
>  
>  	/* Valid check */
> -	if (armada_is_valid(priv)) {
> +	if (!armada_is_valid(priv)) {
>  		dev_err(priv->dev,
>  			"Temperature sensor reading not valid\n");
>  		return -EIO;
>
Russell King (Oracle) Dec. 3, 2018, 4:51 p.m. UTC | #3
*ping*

On Fri, Nov 09, 2018 at 04:44:14PM +0000, Russell King wrote:
> Commit 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid()
> pointer") removed the unnecessary indirection through a function
> pointer, but in doing so, also removed the negation operator too:
> 
> -       if (priv->data->is_valid && !priv->data->is_valid(priv)) {
> +       if (armada_is_valid(priv)) {
> 
> which results in:
> 
> armada_thermal f06f808c.thermal: Temperature sensor reading not valid
> armada_thermal f2400078.thermal: Temperature sensor reading not valid
> armada_thermal f4400078.thermal: Temperature sensor reading not valid
> 
> at boot, or whenever the "temp" sysfs file is read.  Replace the
> negation operator.
> 
> Fixes: 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid() pointer")
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/thermal/armada_thermal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
> index 2c2f6d93034e..e16b3cb1808c 100644
> --- a/drivers/thermal/armada_thermal.c
> +++ b/drivers/thermal/armada_thermal.c
> @@ -357,7 +357,7 @@ static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
>  	int ret;
>  
>  	/* Valid check */
> -	if (armada_is_valid(priv)) {
> +	if (!armada_is_valid(priv)) {
>  		dev_err(priv->dev,
>  			"Temperature sensor reading not valid\n");
>  		return -EIO;
> -- 
> 2.7.4
>
diff mbox series

Patch

diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index 2c2f6d93034e..e16b3cb1808c 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -357,7 +357,7 @@  static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
 	int ret;
 
 	/* Valid check */
-	if (armada_is_valid(priv)) {
+	if (!armada_is_valid(priv)) {
 		dev_err(priv->dev,
 			"Temperature sensor reading not valid\n");
 		return -EIO;