Messages in this thread |  | | | Date | Wed, 24 Sep 2003 20:59:26 +0100 | | From | viro@parcelfa ... | | Subject | Re: [PATCH] [2.4] Re: /proc/ioports overrun patch |
| |
On Wed, Sep 24, 2003 at 08:51:33PM +0100, viro@parcelfarce.linux.theplanet.co.uk wrote:
> Hmm... Why not make the iterator traverse the resource tree instead? > After all, all it takes is addition of pointer to parent resource into > struct resource. Goes for both 2.4 and 2.6...
Hey - it's already there. That makes life very easy - ->next() should do the following: if (resource->child) return resource->child; while (!resource->sibling) { resource = resource->parent; if (!resource) return NULL; } return resource->sibling; AFAICS that should be it - walks the tree in right order. Depth can be trivially found by ->show(), so there's no problems either... - 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/
|  |