Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1672118 > unrolled thread

[PATCH] alienware-wmi: Adjust instance of all wmi_evaluate_method calls to 0

Started byMario Limonciello <mario.limonciello@dell.com>
First post2017-06-22 00:10 +0200
Last post2017-06-23 22:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] alienware-wmi: Adjust instance of all wmi_evaluate_method calls to 0 Mario Limonciello <mario.limonciello@dell.com> - 2017-06-22 00:10 +0200
    Re: [PATCH] alienware-wmi: Adjust instance of all  wmi_evaluate_method calls to 0 Darren Hart <dvhart@infradead.org> - 2017-06-23 22:20 +0200

#1672118 — [PATCH] alienware-wmi: Adjust instance of all wmi_evaluate_method calls to 0

FromMario Limonciello <mario.limonciello@dell.com>
Date2017-06-22 00:10 +0200
Subject[PATCH] alienware-wmi: Adjust instance of all wmi_evaluate_method calls to 0
Message-ID<tUVZ1-3Vj-31@gated-at.bofh.it>
Pali recently noticed that WMI instances are zero indexed.

The only reason that these calls all worked properly is because the ASL
didn't verify the instance number.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
---
 drivers/platform/x86/alienware-wmi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c
index d6b3492..9866fec 100644
--- a/drivers/platform/x86/alienware-wmi.c
+++ b/drivers/platform/x86/alienware-wmi.c
@@ -303,7 +303,7 @@ static int alienware_update_led(struct platform_zone *zone)
 	}
 	pr_debug("alienware-wmi: guid %s method %d\n", guid, method_id);
 
-	status = wmi_evaluate_method(guid, 1, method_id, &input, NULL);
+	status = wmi_evaluate_method(guid, 0, method_id, &input, NULL);
 	if (ACPI_FAILURE(status))
 		pr_err("alienware-wmi: zone set failure: %u\n", status);
 	return ACPI_FAILURE(status);
@@ -352,7 +352,7 @@ static int wmax_brightness(int brightness)
 	};
 	input.length = (acpi_size) sizeof(args);
 	input.pointer = &args;
-	status = wmi_evaluate_method(WMAX_CONTROL_GUID, 1,
+	status = wmi_evaluate_method(WMAX_CONTROL_GUID, 0,
 				     WMAX_METHOD_BRIGHTNESS, &input, NULL);
 	if (ACPI_FAILURE(status))
 		pr_err("alienware-wmi: brightness set failure: %u\n", status);
@@ -506,10 +506,10 @@ static acpi_status alienware_wmax_command(struct wmax_basic_args *in_args,
 	if (out_data != NULL) {
 		output.length = ACPI_ALLOCATE_BUFFER;
 		output.pointer = NULL;
-		status = wmi_evaluate_method(WMAX_CONTROL_GUID, 1,
+		status = wmi_evaluate_method(WMAX_CONTROL_GUID, 0,
 					     command, &input, &output);
 	} else
-		status = wmi_evaluate_method(WMAX_CONTROL_GUID, 1,
+		status = wmi_evaluate_method(WMAX_CONTROL_GUID, 0,
 					     command, &input, NULL);
 
 	if (ACPI_SUCCESS(status) && out_data != NULL) {
-- 
2.7.4

[toc] | [next] | [standalone]


#1673819 — Re: [PATCH] alienware-wmi: Adjust instance of all wmi_evaluate_method calls to 0

FromDarren Hart <dvhart@infradead.org>
Date2017-06-23 22:20 +0200
SubjectRe: [PATCH] alienware-wmi: Adjust instance of all wmi_evaluate_method calls to 0
Message-ID<tVDdE-6Lb-17@gated-at.bofh.it>
In reply to#1672118
On Wed, Jun 21, 2017 at 05:01:35PM -0500, Mario Limonciello wrote:
> Pali recently noticed that WMI instances are zero indexed.
> 
> The only reason that these calls all worked properly is because the ASL
> didn't verify the instance number.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>

Thanks Mario,

Queued to testing.

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web