lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 25 Jul 2019 20:58:43 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Kelsey Skunberg <skunberg.kelsey@...il.com>
Cc:     Darren Hart <dvhart@...radead.org>,
        Andy Shevchenko <andy@...radead.org>,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        bjorn@...gaas.com, "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Shuah Khan <skhan@...uxfoundation.org>,
        linux-kernel-mentees@...ts.linuxfoundation.org
Subject: Re: [PATCH] platform: x86: Remove acpi_has_method() call in wmi.c

On Mon, Jul 22, 2019 at 6:13 AM Kelsey Skunberg
<skunberg.kelsey@...il.com> wrote:
>
> acpi_has_method() is unnecessary within __query_block() and should be
> removed to avoid extra work.
>
> wc_status is initialized to AE_ERROR before the acpi_has_method() call.
> acpi_has_method() and acpi_execute_simple_method() failing due to the
> method not existing will result in the same outcome from __query_block().
>

Pushed to my review and testing queue, thanks!

> Signed-off-by: Kelsey Skunberg <skunberg.kelsey@...il.com>
> ---
>  drivers/platform/x86/wmi.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> index 784cea8572c2..59e9aa0f9643 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -340,9 +340,7 @@ static acpi_status __query_block(struct wmi_block *wblock, u8 instance,
>                  * expensive, but have no corresponding WCxx method. So we
>                  * should not fail if this happens.
>                  */
> -               if (acpi_has_method(handle, wc_method))
> -                       wc_status = acpi_execute_simple_method(handle,
> -                                                               wc_method, 1);
> +               wc_status = acpi_execute_simple_method(handle, wc_method, 1);
>         }
>
>         strcpy(method, "WQ");
> --
> 2.20.1
>


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ