* [PATCH] ACPI: dock: Remove redundant ACPI NS walk
@ 2012-09-12 20:30 Toshi Kani
2012-10-09 13:46 ` Toshi Kani
2012-10-10 1:14 ` Yasuaki Ishimatsu
0 siblings, 2 replies; 6+ messages in thread
From: Toshi Kani @ 2012-09-12 20:30 UTC (permalink / raw)
To: linux-acpi, lenb; +Cc: linux-kernel, shli, Toshi Kani
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>
---
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;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPI: dock: Remove redundant ACPI NS walk
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
1 sibling, 0 replies; 6+ messages in thread
From: Toshi Kani @ 2012-10-09 13:46 UTC (permalink / raw)
To: linux-acpi; +Cc: lenb, linux-kernel, shli
Hi Len,
Can you please review this patch? Please let me know if there is
anything I need to do for 3.7.
Thanks,
-Toshi
On Wed, 2012-09-12 at 14:30 -0600, 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>
> ---
> 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;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPI: dock: Remove redundant ACPI NS walk
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
2012-10-10 13:20 ` Toshi Kani
1 sibling, 1 reply; 6+ messages in thread
From: Yasuaki Ishimatsu @ 2012-10-10 1:14 UTC (permalink / raw)
To: Toshi Kani; +Cc: linux-acpi, lenb, linux-kernel, shli
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;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPI: dock: Remove redundant ACPI NS walk
2012-10-10 1:14 ` Yasuaki Ishimatsu
@ 2012-10-10 13:20 ` Toshi Kani
2012-10-11 15:29 ` Toshi Kani
0 siblings, 1 reply; 6+ messages in thread
From: Toshi Kani @ 2012-10-10 13:20 UTC (permalink / raw)
To: Yasuaki Ishimatsu; +Cc: linux-acpi, lenb, linux-kernel, shli
On Wed, 2012-10-10 at 10:14 +0900, Yasuaki Ishimatsu wrote:
> 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>
Hi Yasuaki,
Thanks for the review! I did test the patch with _DCK and PNP0C0A in
ACPI.
-Toshi
>
> 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;
> >
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPI: dock: Remove redundant ACPI NS walk
2012-10-10 13:20 ` Toshi Kani
@ 2012-10-11 15:29 ` Toshi Kani
2012-10-24 22:07 ` Rafael J. Wysocki
0 siblings, 1 reply; 6+ messages in thread
From: Toshi Kani @ 2012-10-11 15:29 UTC (permalink / raw)
To: Yasuaki Ishimatsu; +Cc: linux-acpi, lenb, linux-kernel, shli
Hi Len,
Can you please review this patch?
Thanks,
-Toshi
On Wed, 2012-10-10 at 07:20 -0600, Toshi Kani wrote:
> On Wed, 2012-10-10 at 10:14 +0900, Yasuaki Ishimatsu wrote:
> > 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>
>
> Hi Yasuaki,
>
> Thanks for the review! I did test the patch with _DCK and PNP0C0A in
> ACPI.
>
> -Toshi
>
>
> >
> > 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;
> > >
> >
> >
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPI: dock: Remove redundant ACPI NS walk
2012-10-11 15:29 ` Toshi Kani
@ 2012-10-24 22:07 ` Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2012-10-24 22:07 UTC (permalink / raw)
To: Toshi Kani; +Cc: Yasuaki Ishimatsu, linux-acpi, lenb, linux-kernel, shli
On Thursday 11 of October 2012 09:29:45 Toshi Kani wrote:
> Hi Len,
>
> Can you please review this patch?
Applied to linux-pm.git/acpi-next as v3.8 material.
Thanks,
Rafael
> On Wed, 2012-10-10 at 07:20 -0600, Toshi Kani wrote:
> > On Wed, 2012-10-10 at 10:14 +0900, Yasuaki Ishimatsu wrote:
> > > 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>
> >
> > Hi Yasuaki,
> >
> > Thanks for the review! I did test the patch with _DCK and PNP0C0A in
> > ACPI.
> >
> > -Toshi
> >
> >
> > >
> > > 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;
> > > >
> > >
> > >
> >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-10-24 22:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-10-10 13:20 ` Toshi Kani
2012-10-11 15:29 ` Toshi Kani
2012-10-24 22:07 ` Rafael J. Wysocki
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).