Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1568326 > unrolled thread

[PATCH] Input: synaptics-rmi4 - Fix reversed tests

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2017-01-27 13:20 +0100
Last post2017-01-31 10:00 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Input: synaptics-rmi4 - Fix reversed tests Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-01-27 13:20 +0100
    Re: [PATCH] Input: synaptics-rmi4 - Fix reversed tests Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-01-27 18:30 +0100
      Re: [PATCH] Input: synaptics-rmi4 - Fix reversed tests Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-31 10:00 +0100

#1568326 — [PATCH] Input: synaptics-rmi4 - Fix reversed tests

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-01-27 13:20 +0100
Subject[PATCH] Input: synaptics-rmi4 - Fix reversed tests
Message-ID<t4dFv-42B-1@gated-at.bofh.it>
These tests looks reversed.
A warning should be displayed if an error is returned, not on success.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/input/rmi4/rmi_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 11447ab1055c..bf5c36e229ba 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -901,7 +901,7 @@ void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake)
 	data->enabled = true;
 	if (clear_wake && device_may_wakeup(rmi_dev->xport->dev)) {
 		retval = disable_irq_wake(irq);
-		if (!retval)
+		if (retval)
 			dev_warn(&rmi_dev->dev,
 				 "Failed to disable irq for wake: %d\n",
 				 retval);
@@ -936,7 +936,7 @@ void rmi_disable_irq(struct rmi_device *rmi_dev, bool enable_wake)
 	disable_irq(irq);
 	if (enable_wake && device_may_wakeup(rmi_dev->xport->dev)) {
 		retval = enable_irq_wake(irq);
-		if (!retval)
+		if (retval)
 			dev_warn(&rmi_dev->dev,
 				 "Failed to enable irq for wake: %d\n",
 				 retval);
-- 
2.9.3

[toc] | [next] | [standalone]


#1568534

FromBenjamin Tissoires <benjamin.tissoires@redhat.com>
Date2017-01-27 18:30 +0100
Message-ID<t4ivw-70N-21@gated-at.bofh.it>
In reply to#1568326
On Jan 27 2017 or thereabouts, Christophe JAILLET wrote:
> These tests looks reversed.
> A warning should be displayed if an error is returned, not on success.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---

Good catch!

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Cheers,
Benjamin


>  drivers/input/rmi4/rmi_driver.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
> index 11447ab1055c..bf5c36e229ba 100644
> --- a/drivers/input/rmi4/rmi_driver.c
> +++ b/drivers/input/rmi4/rmi_driver.c
> @@ -901,7 +901,7 @@ void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake)
>  	data->enabled = true;
>  	if (clear_wake && device_may_wakeup(rmi_dev->xport->dev)) {
>  		retval = disable_irq_wake(irq);
> -		if (!retval)
> +		if (retval)
>  			dev_warn(&rmi_dev->dev,
>  				 "Failed to disable irq for wake: %d\n",
>  				 retval);
> @@ -936,7 +936,7 @@ void rmi_disable_irq(struct rmi_device *rmi_dev, bool enable_wake)
>  	disable_irq(irq);
>  	if (enable_wake && device_may_wakeup(rmi_dev->xport->dev)) {
>  		retval = enable_irq_wake(irq);
> -		if (!retval)
> +		if (retval)
>  			dev_warn(&rmi_dev->dev,
>  				 "Failed to enable irq for wake: %d\n",
>  				 retval);
> -- 
> 2.9.3
> 

[toc] | [prev] | [next] | [standalone]


#1570492

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-01-31 10:00 +0100
Message-ID<t5Csb-70d-35@gated-at.bofh.it>
In reply to#1568534
On Fri, Jan 27, 2017 at 06:18:27PM +0100, Benjamin Tissoires wrote:
> On Jan 27 2017 or thereabouts, Christophe JAILLET wrote:
> > These tests looks reversed.
> > A warning should be displayed if an error is returned, not on success.
> > 
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > ---
> 
> Good catch!
> 
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Applied, thank you.

> 
> Cheers,
> Benjamin
> 
> 
> >  drivers/input/rmi4/rmi_driver.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
> > index 11447ab1055c..bf5c36e229ba 100644
> > --- a/drivers/input/rmi4/rmi_driver.c
> > +++ b/drivers/input/rmi4/rmi_driver.c
> > @@ -901,7 +901,7 @@ void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake)
> >  	data->enabled = true;
> >  	if (clear_wake && device_may_wakeup(rmi_dev->xport->dev)) {
> >  		retval = disable_irq_wake(irq);
> > -		if (!retval)
> > +		if (retval)
> >  			dev_warn(&rmi_dev->dev,
> >  				 "Failed to disable irq for wake: %d\n",
> >  				 retval);
> > @@ -936,7 +936,7 @@ void rmi_disable_irq(struct rmi_device *rmi_dev, bool enable_wake)
> >  	disable_irq(irq);
> >  	if (enable_wake && device_may_wakeup(rmi_dev->xport->dev)) {
> >  		retval = enable_irq_wake(irq);
> > -		if (!retval)
> > +		if (retval)
> >  			dev_warn(&rmi_dev->dev,
> >  				 "Failed to enable irq for wake: %d\n",
> >  				 retval);
> > -- 
> > 2.9.3
> > 

-- 
Dmitry

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web