linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
* [Linux-kernel-mentees] [PATCH] platform: x86: Remove acpi_has_method() call in wmi.c
@ 2019-07-22  3:11 skunberg.kelsey
  2019-07-22  3:11 ` Kelsey Skunberg
  2019-07-25 17:58 ` andy.shevchenko
  0 siblings, 2 replies; 4+ messages in thread
From: skunberg.kelsey @ 2019-07-22  3:11 UTC (permalink / raw)


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().

Signed-off-by: Kelsey Skunberg <skunberg.kelsey at gmail.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

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

* [Linux-kernel-mentees] [PATCH] platform: x86: Remove acpi_has_method() call in wmi.c
  2019-07-22  3:11 [Linux-kernel-mentees] [PATCH] platform: x86: Remove acpi_has_method() call in wmi.c skunberg.kelsey
@ 2019-07-22  3:11 ` Kelsey Skunberg
  2019-07-25 17:58 ` andy.shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Kelsey Skunberg @ 2019-07-22  3:11 UTC (permalink / raw)


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().

Signed-off-by: Kelsey Skunberg <skunberg.kelsey at gmail.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

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

* [Linux-kernel-mentees] [PATCH] platform: x86: Remove acpi_has_method() call in wmi.c
  2019-07-22  3:11 [Linux-kernel-mentees] [PATCH] platform: x86: Remove acpi_has_method() call in wmi.c skunberg.kelsey
  2019-07-22  3:11 ` Kelsey Skunberg
@ 2019-07-25 17:58 ` andy.shevchenko
  2019-07-25 17:58   ` Andy Shevchenko
  1 sibling, 1 reply; 4+ messages in thread
From: andy.shevchenko @ 2019-07-25 17:58 UTC (permalink / raw)


On Mon, Jul 22, 2019 at 6:13 AM Kelsey Skunberg
<skunberg.kelsey at gmail.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 at gmail.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

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

* [Linux-kernel-mentees] [PATCH] platform: x86: Remove acpi_has_method() call in wmi.c
  2019-07-25 17:58 ` andy.shevchenko
@ 2019-07-25 17:58   ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2019-07-25 17:58 UTC (permalink / raw)


On Mon, Jul 22, 2019 at 6:13 AM Kelsey Skunberg
<skunberg.kelsey at gmail.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 at gmail.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

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

end of thread, other threads:[~2019-07-25 17:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22  3:11 [Linux-kernel-mentees] [PATCH] platform: x86: Remove acpi_has_method() call in wmi.c skunberg.kelsey
2019-07-22  3:11 ` Kelsey Skunberg
2019-07-25 17:58 ` andy.shevchenko
2019-07-25 17:58   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).