Re: [PATCH] platform/x86: asus-wmi: Fix condition in charge_threshold_store()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 2, 2019 at 5:41 PM Dan Carpenter <dan.carpenter@xxxxxxxxxx> 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@xxxxxxxxxx>
> ---
>  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



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux