All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Starikovskiy <aystarik@gmail.com>
To: Lin Ming <ming.m.lin@intel.com>
Cc: Len Brown <lenb@kernel.org>,
	"Moore, Robert" <robert.moore@intel.com>,
	linux-acpi <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH 7/8] acpi: avoid using internal acpica structures
Date: Wed, 26 Nov 2008 13:31:35 +0300	[thread overview]
Message-ID: <492D2587.9070408@gmail.com> (raw)
In-Reply-To: <1227692693.16339.8.camel@minggr.sh.intel.com>

Lin Ming wrote:
> On Wed, 2008-11-26 at 16:12 +0800, Alexey Starikovskiy wrote:
>   
>> At least, this patch should be split in two -- for each file it touches.
>>     
>
> OK, will split it into two.
>
>   
>> Second, please don't return failure status from this function, as all 
>> functions under
>> the EC scope should be tried, and not only ones before first failure.
>>     
>
> How about below patch?
>
> ---
>  drivers/acpi/ec.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
> index 591b4f6..99bff80 100644
> --- a/drivers/acpi/ec.c
> +++ b/drivers/acpi/ec.c
> @@ -754,12 +754,20 @@ static acpi_status
>  acpi_ec_register_query_methods(acpi_handle handle, u32 level,
>  			       void *context, void **return_value)
>  {
> -	struct acpi_namespace_node *node = handle;
> +	char node_name[5];
> +	struct acpi_buffer buffer = { sizeof(node_name), node_name };
>  	struct acpi_ec *ec = context;
>  	int value = 0;
> -	if (sscanf(node->name.ascii, "_Q%x", &value) == 1) {
> -		acpi_ec_add_query_handler(ec, value, handle, NULL, NULL);
> +	acpi_status status;
>   
> +
> +	status = acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer);
>   
Merge the above two lines?
> +
> +	if (ACPI_SUCCESS(status)) {
> +		if (sscanf(node_name, "_Q%x", &value) == 1) {
>   
single if (ACPI_SUCCESS(status) && sscanf(node_name, "_Q%x", &value) == 1) ?
> +			acpi_ec_add_query_handler(ec, value, handle, NULL, NULL);
> +		}
>  	}
> +       
>  	return AE_OK;
>  }
>  
>
> Thanks for review,
> Lin Ming
>   

  reply	other threads:[~2008-11-26 10:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26  2:56 [PATCH 7/8] acpi: avoid using internal acpica structures Lin Ming
2008-11-26  8:12 ` Alexey Starikovskiy
2008-11-26  9:44   ` Lin Ming
2008-11-26 10:31     ` Alexey Starikovskiy [this message]
     [not found]       ` <d3f22a0811261702q39d89093y52d22c3e9ea0e488@mail.gmail.com>
2008-11-27  1:03         ` Lin Ming

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=492D2587.9070408@gmail.com \
    --to=aystarik@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --cc=robert.moore@intel.com \
    /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.