lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE9FiQVikZHs1BXLM9v-aAK-N4Ub4Rv-xHvq-r+82FakDK4JPw@mail.gmail.com>
Date:	Fri, 28 Jun 2013 13:08:14 -0700
From:	Yinghai Lu <yinghai@...nel.org>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Jiang Liu <liuj97@...il.com>,
	"Alexander E. Patrakov" <patrakov@...il.com>
Subject: Re: [PATCH 2/4] ACPI / dock: Rework and simplify find_dock_devices()

On Fri, Jun 28, 2013 at 12:46 PM, Rafael J. Wysocki <rjw@...k.pl> wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Since acpi_walk_namespace() calls find_dock_devices() during tree
> pre-order visit, the latter doesn't need to add devices whose
> parents have _EJD pointing to the docking station to the list of
> that station's dependent devices, because those parents are going to
> be added to that list anyway and the removal of a parent will take
> care of the removal of its children in those cases.
>
> For this reason, rework find_dock_devices() to only call
> add_dock_dependent_device() for devices whose _EJD point directy to
> the docking station represented by its context argument and simplify
> it slightly.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

Acked-by: Yinghai Lu <yinghai@...nel.org>

> ---
>  drivers/acpi/dock.c |   19 +++----------------
>  1 file changed, 3 insertions(+), 16 deletions(-)
>
> Index: linux-pm/drivers/acpi/dock.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/dock.c
> +++ linux-pm/drivers/acpi/dock.c
> @@ -855,26 +855,13 @@ static struct notifier_block dock_acpi_n
>  static acpi_status
>  find_dock_devices(acpi_handle handle, u32 lvl, void *context, void **rv)
>  {
> -       acpi_status status;
> -       acpi_handle tmp, parent;
>         struct dock_station *ds = context;
> +       acpi_handle ejd = NULL;
>
> -       status = acpi_bus_get_ejd(handle, &tmp);
> -       if (ACPI_FAILURE(status)) {
> -               /* try the parent device as well */
> -               status = acpi_get_parent(handle, &parent);
> -               if (ACPI_FAILURE(status))
> -                       goto fdd_out;
> -               /* see if parent is dependent on dock */
> -               status = acpi_bus_get_ejd(parent, &tmp);
> -               if (ACPI_FAILURE(status))
> -                       goto fdd_out;
> -       }
> -
> -       if (tmp == ds->handle)
> +       acpi_bus_get_ejd(handle, &ejd);
> +       if (ejd == ds->handle)
>                 add_dock_dependent_device(ds, handle);
>
> -fdd_out:
>         return AE_OK;
>  }
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ