Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261427AbTIXT71 (ORCPT ); Wed, 24 Sep 2003 15:59:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261433AbTIXT71 (ORCPT ); Wed, 24 Sep 2003 15:59:27 -0400 Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:49627 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id S261427AbTIXT70 (ORCPT ); Wed, 24 Sep 2003 15:59:26 -0400 Date: Wed, 24 Sep 2003 20:59:26 +0100 From: viro@parcelfarce.linux.theplanet.co.uk To: olof@austin.ibm.com Cc: Marcelo Tosatti , lkml Subject: Re: [PATCH] [2.4] Re: /proc/ioports overrun patch Message-ID: <20030924195926.GZ7665@parcelfarce.linux.theplanet.co.uk> References: <20030924195133.GY7665@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030924195133.GY7665@parcelfarce.linux.theplanet.co.uk> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 925 Lines: 24 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/