All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: asus-wmi: Fix condition in charge_threshold_store()
@ 2019-09-02 14:38 Dan Carpenter
  2019-09-02 15:12 ` Andy Shevchenko
  2019-09-02 17:24 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-09-02 14:38 UTC (permalink / raw)
  To: kernel-janitors

This error handling is reversed so we return early.

Fixes: 84d8e80b0a36 ("platform/x86: asus-wmi: Refactor charge_threshold_store()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/platform/x86/asus-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 14467748b343..848b23764fc3 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -2068,7 +2068,7 @@ static ssize_t charge_threshold_store(struct device *dev,
 		return -EINVAL;
 
 	ret = asus_wmi_set_devstate(ASUS_WMI_CHARGE_THRESHOLD, value, &rv);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	if (rv != 1)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/x86: asus-wmi: Fix condition in charge_threshold_store()
  2019-09-02 14:38 [PATCH] platform/x86: asus-wmi: Fix condition in charge_threshold_store() Dan Carpenter
@ 2019-09-02 15:12 ` Andy Shevchenko
  2019-09-02 17:24 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2019-09-02 15:12 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Sep 2, 2019 at 5:41 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> This error handling is reversed so we return early.
>

I will squash to the original commit since it's not yet upstream.

Are you okay with this?

> Fixes: 84d8e80b0a36 ("platform/x86: asus-wmi: Refactor charge_threshold_store()")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/platform/x86/asus-wmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 14467748b343..848b23764fc3 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -2068,7 +2068,7 @@ static ssize_t charge_threshold_store(struct device *dev,
>                 return -EINVAL;
>
>         ret = asus_wmi_set_devstate(ASUS_WMI_CHARGE_THRESHOLD, value, &rv);
> -       if (!ret)
> +       if (ret)
>                 return ret;
>
>         if (rv != 1)
> --
> 2.20.1
>


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/x86: asus-wmi: Fix condition in charge_threshold_store()
  2019-09-02 14:38 [PATCH] platform/x86: asus-wmi: Fix condition in charge_threshold_store() Dan Carpenter
  2019-09-02 15:12 ` Andy Shevchenko
@ 2019-09-02 17:24 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-09-02 17:24 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Sep 02, 2019 at 06:12:07PM +0300, Andy Shevchenko wrote:
> On Mon, Sep 2, 2019 at 5:41 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >
> > This error handling is reversed so we return early.
> >
> 
> I will squash to the original commit since it's not yet upstream.
> 
> Are you okay with this?
> 

Sure.  That's fine.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-02 17:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-02 14:38 [PATCH] platform/x86: asus-wmi: Fix condition in charge_threshold_store() Dan Carpenter
2019-09-02 15:12 ` Andy Shevchenko
2019-09-02 17:24 ` Dan Carpenter

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.