linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kelsey Skunberg <skunberg.kelsey@gmail.com>
To: dvhart@infradead.org, andy@infradead.org,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: bjorn@helgaas.com, rjw@rjwysocki.net, skunberg.kelsey@gmail.com,
	skhan@linuxfoundation.org,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: [PATCH] platform: x86: Remove acpi_has_method() call in wmi.c
Date: Sun, 21 Jul 2019 21:11:58 -0600	[thread overview]
Message-ID: <20190722031158.70311-1-skunberg.kelsey@gmail.com> (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@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


             reply	other threads:[~2019-07-22  3:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22  3:11 Kelsey Skunberg [this message]
2019-07-25 17:58 ` [PATCH] platform: x86: Remove acpi_has_method() call in wmi.c Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190722031158.70311-1-skunberg.kelsey@gmail.com \
    --to=skunberg.kelsey@gmail.com \
    --cc=andy@infradead.org \
    --cc=bjorn@helgaas.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).