lkml.org 
[lkml]   [2003]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-03-22 13:48    [from the cache]
©2003-2011 Jasper Spaans