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

Dmitry Torokhov
2004-09-20T18:26:44Z

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...

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.

--
Dmitry
N\x18¬HS^µéšŠX¬²š'²ŠÞu¼˜9@DLq P1„\x05ê'z‡õïCë¢7œ´\afŠ{-¢·œz+Þjp)¦W¢>‡LŠx…DA\x1f¢¼¨º¸îv\a¦z{hŸ\bh¦Ší³*.®šèç-¶‚âžìO<+ay·¬µ*hžÊ+yÖò \x13\x03y§eŠw’z›vàj!z·¡¶Ú\x7fþÇçzßé¥Ç(ž×¬¶˜i