From: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>
To: Darren Hart <dvhart@infradead.org>
Cc: platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, "Lee, Chun-Yi" <jlee@suse.com>,
"Andy Shevchenko" <andy@infradead.org>,
"Pali Rohár" <pali.rohar@gmail.com>
Subject: [PATCH] acer-wmi: Using zero as the first WMI instance number
Date: Tue, 20 Jun 2017 17:06:23 +0800 [thread overview]
Message-ID: <20170620090623.18364-1-jlee@suse.com> (raw)
Pali Rohár found that there have some wmi query/evaluation
code that they used 'one' as the first WMI instance number.
But the number is indexed from zero that it's must less than
the instance_count in _WDG.
This patch changes those instance number from one to zero.
Cc: Darren Hart <dvhart@infradead.org>
Cc: Andy Shevchenko <andy@infradead.org>
Cc: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com>
---
drivers/platform/x86/acer-wmi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 79fa5ab..ef420b6 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -700,7 +700,7 @@ struct acpi_buffer *result)
input.length = sizeof(struct wmab_args);
input.pointer = (u8 *)regbuf;
- status = wmi_evaluate_method(AMW0_GUID1, 1, 1, &input, result);
+ status = wmi_evaluate_method(AMW0_GUID1, 0, 1, &input, result);
return status;
}
@@ -965,7 +965,7 @@ WMI_execute_u32(u32 method_id, u32 in, u32 *out)
u32 tmp = 0;
acpi_status status;
- status = wmi_evaluate_method(WMID_GUID1, 1, method_id, &input, &result);
+ status = wmi_evaluate_method(WMID_GUID1, 0, method_id, &input, &result);
if (ACPI_FAILURE(status))
return status;
@@ -1275,7 +1275,7 @@ static acpi_status __init WMID_set_capabilities(void)
acpi_status status;
u32 devices;
- status = wmi_query_block(WMID_GUID2, 1, &out);
+ status = wmi_query_block(WMID_GUID2, 0, &out);
if (ACPI_FAILURE(status))
return status;
@@ -2018,7 +2018,7 @@ static u32 get_wmid_devices(void)
acpi_status status;
u32 devices = 0;
- status = wmi_query_block(WMID_GUID2, 1, &out);
+ status = wmi_query_block(WMID_GUID2, 0, &out);
if (ACPI_FAILURE(status))
return 0;
--
2.10.2
next reply other threads:[~2017-06-20 9:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-20 9:06 Lee, Chun-Yi [this message]
2017-06-20 16:48 ` [PATCH] acer-wmi: Using zero as the first WMI instance number Pali Rohár
2017-06-20 17:22 ` Andy Shevchenko
2017-06-20 20:46 ` Pali Rohár
2017-06-20 21:45 ` Darren Hart
2017-06-21 4:35 ` joeyli
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=20170620090623.18364-1-jlee@suse.com \
--to=joeyli.kernel@gmail.com \
--cc=andy@infradead.org \
--cc=dvhart@infradead.org \
--cc=jlee@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pali.rohar@gmail.com \
--cc=platform-driver-x86@vger.kernel.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 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.