Re: [ACPI] PATCH-ACPI based CPU hotplug[1/6]-ACPI core enhancement support

From: Keshavamurthy Anil S <anil.s.keshavamurthy_at_intel.com>
Date: 2004-09-21 05:01:28
On Mon, Sep 20, 2004 at 01:26:44PM -0500, Dmitry Torokhov wrote:
> On Monday 20 September 2004 11:34 am, Keshavamurthy Anil S wrote:
> > +void
> > +acpi_bus_trim(struct acpi_device       *start,
> > +               int rmdevice)
> > +{
> > +       acpi_status             status = AE_OK;
> > +       struct acpi_device      *parent = NULL;
> > +       struct acpi_device      *child = NULL;
> > +       acpi_handle             phandle = 0;
> > +       acpi_handle             chandle = 0;
> > +
> > +       parent  = start;
> > +       phandle = start->handle;
> 
> 
> Why do all these variables have to be initialized? parent and phandle are
> set up explicitly couple of lines below, the rest is only used safely
> as well...
You are correct, variable initialization can be removed. I will do this.

> 
> Also, introducing recursion (depth does not seem to be limited here) is
> not a good idea IMHO - better convert it into iteration to avoid stack
> problems down teh road.
Humm, I guess recursion should be fine and even though the code does not have
an explicit limit, the ACPI namespace describing the Ejectable device will limit the
number of recursible devices. And I believe this won;t be more than 3 to 4 level depth.
Hence recursion is fine here.

If you still strongly believe that recursion is not the right choice here, 
let me know and I will convert it to iteration.

Thanks,
Anil
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon Sep 20 15:01:59 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:30 EST