linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] acer-wmi: Using zero as the first WMI instance number
@ 2017-06-20  9:06 Lee, Chun-Yi
  2017-06-20 16:48 ` Pali Rohár
  0 siblings, 1 reply; 6+ messages in thread
From: Lee, Chun-Yi @ 2017-06-20  9:06 UTC (permalink / raw)
  To: Darren Hart
  Cc: platform-driver-x86, linux-kernel, Lee, Chun-Yi, Andy Shevchenko,
	Pali Rohár

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

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

* Re: [PATCH] acer-wmi: Using zero as the first WMI instance number
  2017-06-20  9:06 [PATCH] acer-wmi: Using zero as the first WMI instance number Lee, Chun-Yi
@ 2017-06-20 16:48 ` Pali Rohár
  2017-06-20 17:22   ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Pali Rohár @ 2017-06-20 16:48 UTC (permalink / raw)
  To: Lee, Chun-Yi
  Cc: Darren Hart, platform-driver-x86, linux-kernel, Lee, Chun-Yi,
	Andy Shevchenko

On Tuesday 20 June 2017 17:06:23 Lee, Chun-Yi wrote:
> 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>

Looks good, Reviewed-by: Pali Rohár <pali.rohar@gmail.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;
>  

-- 
Pali Rohár
pali.rohar@gmail.com

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

* Re: [PATCH] acer-wmi: Using zero as the first WMI instance number
  2017-06-20 16:48 ` Pali Rohár
@ 2017-06-20 17:22   ` Andy Shevchenko
  2017-06-20 20:46     ` Pali Rohár
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2017-06-20 17:22 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Lee, Chun-Yi, Darren Hart, Platform Driver, linux-kernel, Lee,
	Chun-Yi, Andy Shevchenko

On Tue, Jun 20, 2017 at 7:48 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
> On Tuesday 20 June 2017 17:06:23 Lee, Chun-Yi wrote:
>> 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>
>
> Looks good, Reviewed-by: Pali Rohár <pali.rohar@gmail.com>

Unfortunately patchwork ignores this tag.
So, in the future please:
- put a tag on a separate line
- do _not_ prepend it by any characters including white spaces (except
new line :-) )

No need to resend this one.

Pushed to testing, thanks!

>
>> ---
>>  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;
>>
>
> --
> Pali Rohár
> pali.rohar@gmail.com



-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] acer-wmi: Using zero as the first WMI instance number
  2017-06-20 17:22   ` Andy Shevchenko
@ 2017-06-20 20:46     ` Pali Rohár
  2017-06-20 21:45       ` Darren Hart
  0 siblings, 1 reply; 6+ messages in thread
From: Pali Rohár @ 2017-06-20 20:46 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Lee, Chun-Yi, Darren Hart, Platform Driver, linux-kernel, Lee,
	Chun-Yi, Andy Shevchenko

[-- Attachment #1: Type: Text/Plain, Size: 1167 bytes --]

On Tuesday 20 June 2017 19:22:46 Andy Shevchenko wrote:
> On Tue, Jun 20, 2017 at 7:48 PM, Pali Rohár <pali.rohar@gmail.com>
> wrote:
> > On Tuesday 20 June 2017 17:06:23 Lee, Chun-Yi wrote:
> >> 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>
> > 
> > Looks good, Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
> 
> Unfortunately patchwork ignores this tag.
> So, in the future please:
> - put a tag on a separate line
> - do _not_ prepend it by any characters including white spaces
> (except new line :-) )

I have not known that those lines are parsed automatically.
Will do it in future!

> No need to resend this one.
> 
> Pushed to testing, thanks!

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] acer-wmi: Using zero as the first WMI instance number
  2017-06-20 20:46     ` Pali Rohár
@ 2017-06-20 21:45       ` Darren Hart
  2017-06-21  4:35         ` joeyli
  0 siblings, 1 reply; 6+ messages in thread
From: Darren Hart @ 2017-06-20 21:45 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Andy Shevchenko, Lee, Chun-Yi, Platform Driver, linux-kernel,
	Lee, Chun-Yi, Andy Shevchenko

On Tue, Jun 20, 2017 at 10:46:12PM +0200, Pali Rohár wrote:
> On Tuesday 20 June 2017 19:22:46 Andy Shevchenko wrote:
> > On Tue, Jun 20, 2017 at 7:48 PM, Pali Rohár <pali.rohar@gmail.com>
> > wrote:
> > > On Tuesday 20 June 2017 17:06:23 Lee, Chun-Yi wrote:
> > >> 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>
> > > 
> > > Looks good, Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
> > 
> > Unfortunately patchwork ignores this tag.
> > So, in the future please:
> > - put a tag on a separate line
> > - do _not_ prepend it by any characters including white spaces
> > (except new line :-) )
> 
> I have not known that those lines are parsed automatically.
> Will do it in future!

:-) Thanks!

For reference, Patchwork tally's such things in the patch list view:
https://patchwork.kernel.org/project/platform-driver-x86/list/

And, selfishly, the more normalized these are, the less likely Andy and I are to
make mistakes manipulating them into the patches.

-- 
Darren Hart
VMware Open Source Technology Center

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

* Re: [PATCH] acer-wmi: Using zero as the first WMI instance number
  2017-06-20 21:45       ` Darren Hart
@ 2017-06-21  4:35         ` joeyli
  0 siblings, 0 replies; 6+ messages in thread
From: joeyli @ 2017-06-21  4:35 UTC (permalink / raw)
  To: Darren Hart
  Cc: Pali Rohár, Andy Shevchenko, Lee, Chun-Yi, Platform Driver,
	linux-kernel, Andy Shevchenko

On Tue, Jun 20, 2017 at 02:45:56PM -0700, Darren Hart wrote:
> On Tue, Jun 20, 2017 at 10:46:12PM +0200, Pali Rohár wrote:
> > On Tuesday 20 June 2017 19:22:46 Andy Shevchenko wrote:
> > > On Tue, Jun 20, 2017 at 7:48 PM, Pali Rohár <pali.rohar@gmail.com>
> > > wrote:
> > > > On Tuesday 20 June 2017 17:06:23 Lee, Chun-Yi wrote:
> > > >> 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>
> > > > 
> > > > Looks good, Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
> > > 
> > > Unfortunately patchwork ignores this tag.
> > > So, in the future please:
> > > - put a tag on a separate line
> > > - do _not_ prepend it by any characters including white spaces
> > > (except new line :-) )

I see! I will also follow the rules in the future.

> > 
> > I have not known that those lines are parsed automatically.
> > Will do it in future!
> 
> :-) Thanks!
> 
> For reference, Patchwork tally's such things in the patch list view:
> https://patchwork.kernel.org/project/platform-driver-x86/list/
> 
> And, selfishly, the more normalized these are, the less likely Andy and I are to
> make mistakes manipulating them into the patches.
>

Joey Lee

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

end of thread, other threads:[~2017-06-21  4:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-20  9:06 [PATCH] acer-wmi: Using zero as the first WMI instance number Lee, Chun-Yi
2017-06-20 16:48 ` 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

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