> +     for (i = 0; i < list_cells; cur_index++) {
> +             const u32 *cells;
> +             const phandle *phandle;
> +
> +             phandle = list + i;
> +             args = phandle + 1;

Rather than incrementing i, I would just use a running pointer "list"
and drop "i" totally. Not big deal tho.

> +             /* one cell hole in the list = <>; */
> +             if (!*phandle) {
> +                     if (cur_index == index)
> +                             return -ENOENT;
> +                     i++;
> +                     continue;
> +             }

I don't totally understand the above. The 0 phandle terminates the list
or is just an empty slot in it ? In the later case, it might be more
readable to use goto to skip over down to the normal if (cur_index ==
index) break; and let it return via the normal if (!node) return -ENOENT
out of the loop.

Appart from that it's good and I'm fine with putting it in if you respin
despite being a bit late mostly because it's me who is later reviewing
there :-)

Cheers,
Ben.


_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to