From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
To: Toshi Kani <toshi.kani@hp.com>
Cc: linux-acpi@vger.kernel.org, lenb@kernel.org,
linux-kernel@vger.kernel.org, shli@fusionio.com
Subject: Re: [PATCH] ACPI: dock: Remove redundant ACPI NS walk
Date: Wed, 10 Oct 2012 10:14:19 +0900 [thread overview]
Message-ID: <5074CBEB.4040500@jp.fujitsu.com> (raw)
In-Reply-To: <1347481849-17973-1-git-send-email-toshi.kani@hp.com>
Hi Toshi,
Sorry for late reply.
2012/09/13 5:30, Toshi Kani wrote:
> Combined two ACPI namespace walks, which look for dock stations
> and then bays separately, into a single walk.
>
> Signed-off-by: Toshi Kani <toshi.kani@hp.com>
> ---
I have not tested the patch. But it looks good to me.
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Thanks,
Yasuaki Ishimatsu
> drivers/acpi/dock.c | 26 +++++++-------------------
> 1 files changed, 7 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
> index 88eb143..ae4ebf2 100644
> --- a/drivers/acpi/dock.c
> +++ b/drivers/acpi/dock.c
> @@ -1016,44 +1016,32 @@ static int dock_remove(struct dock_station *ds)
> }
>
> /**
> - * find_dock - look for a dock station
> + * find_dock_and_bay - look for dock stations and bays
> * @handle: acpi handle of a device
> * @lvl: unused
> - * @context: counter of dock stations found
> + * @context: unused
> * @rv: unused
> *
> - * This is called by acpi_walk_namespace to look for dock stations.
> + * This is called by acpi_walk_namespace to look for dock stations and bays.
> */
> static __init acpi_status
> -find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
> +find_dock_and_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
> {
> - if (is_dock(handle))
> + if (is_dock(handle) || is_ejectable_bay(handle))
> dock_add(handle);
>
> return AE_OK;
> }
>
> -static __init acpi_status
> -find_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
> -{
> - /* If bay is a dock, it's already handled */
> - if (is_ejectable_bay(handle) && !is_dock(handle))
> - dock_add(handle);
> - return AE_OK;
> -}
> -
> static int __init dock_init(void)
> {
> if (acpi_disabled)
> return 0;
>
> - /* look for a dock station */
> + /* look for dock stations and bays */
> acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
> - ACPI_UINT32_MAX, find_dock, NULL, NULL, NULL);
> + ACPI_UINT32_MAX, find_dock_and_bay, NULL, NULL, NULL);
>
> - /* look for bay */
> - acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
> - ACPI_UINT32_MAX, find_bay, NULL, NULL, NULL);
> if (!dock_station_count) {
> printk(KERN_INFO PREFIX "No dock devices found.\n");
> return 0;
>
WARNING: multiple messages have this Message-ID (diff)
From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
To: Toshi Kani <toshi.kani@hp.com>
Cc: <linux-acpi@vger.kernel.org>, <lenb@kernel.org>,
<linux-kernel@vger.kernel.org>, <shli@fusionio.com>
Subject: Re: [PATCH] ACPI: dock: Remove redundant ACPI NS walk
Date: Wed, 10 Oct 2012 10:14:19 +0900 [thread overview]
Message-ID: <5074CBEB.4040500@jp.fujitsu.com> (raw)
In-Reply-To: <1347481849-17973-1-git-send-email-toshi.kani@hp.com>
Hi Toshi,
Sorry for late reply.
2012/09/13 5:30, Toshi Kani wrote:
> Combined two ACPI namespace walks, which look for dock stations
> and then bays separately, into a single walk.
>
> Signed-off-by: Toshi Kani <toshi.kani@hp.com>
> ---
I have not tested the patch. But it looks good to me.
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Thanks,
Yasuaki Ishimatsu
> drivers/acpi/dock.c | 26 +++++++-------------------
> 1 files changed, 7 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
> index 88eb143..ae4ebf2 100644
> --- a/drivers/acpi/dock.c
> +++ b/drivers/acpi/dock.c
> @@ -1016,44 +1016,32 @@ static int dock_remove(struct dock_station *ds)
> }
>
> /**
> - * find_dock - look for a dock station
> + * find_dock_and_bay - look for dock stations and bays
> * @handle: acpi handle of a device
> * @lvl: unused
> - * @context: counter of dock stations found
> + * @context: unused
> * @rv: unused
> *
> - * This is called by acpi_walk_namespace to look for dock stations.
> + * This is called by acpi_walk_namespace to look for dock stations and bays.
> */
> static __init acpi_status
> -find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
> +find_dock_and_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
> {
> - if (is_dock(handle))
> + if (is_dock(handle) || is_ejectable_bay(handle))
> dock_add(handle);
>
> return AE_OK;
> }
>
> -static __init acpi_status
> -find_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
> -{
> - /* If bay is a dock, it's already handled */
> - if (is_ejectable_bay(handle) && !is_dock(handle))
> - dock_add(handle);
> - return AE_OK;
> -}
> -
> static int __init dock_init(void)
> {
> if (acpi_disabled)
> return 0;
>
> - /* look for a dock station */
> + /* look for dock stations and bays */
> acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
> - ACPI_UINT32_MAX, find_dock, NULL, NULL, NULL);
> + ACPI_UINT32_MAX, find_dock_and_bay, NULL, NULL, NULL);
>
> - /* look for bay */
> - acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
> - ACPI_UINT32_MAX, find_bay, NULL, NULL, NULL);
> if (!dock_station_count) {
> printk(KERN_INFO PREFIX "No dock devices found.\n");
> return 0;
>
next prev parent reply other threads:[~2012-10-10 1:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-12 20:30 [PATCH] ACPI: dock: Remove redundant ACPI NS walk Toshi Kani
2012-10-09 13:46 ` Toshi Kani
2012-10-10 1:14 ` Yasuaki Ishimatsu [this message]
2012-10-10 1:14 ` Yasuaki Ishimatsu
2012-10-10 13:20 ` Toshi Kani
2012-10-11 15:29 ` Toshi Kani
2012-10-24 22:07 ` Rafael J. Wysocki
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=5074CBEB.4040500@jp.fujitsu.com \
--to=isimatu.yasuaki@jp.fujitsu.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shli@fusionio.com \
--cc=toshi.kani@hp.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.