From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Murray Subject: Re: [PATCH] pci: Provide support for parsing PCI DT ranges property Date: Mon, 14 Jan 2013 09:15:26 +0000 Message-ID: <20130114091526.GA23333@arm.com> References: <20121212163749.GA17371@arm.com> <20121220082500.GA32617@avionic-0098.adnet.avionic-design.de> Mime-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Return-path: In-Reply-To: <20121220082500.GA32617@avionic-0098.adnet.avionic-design.de> Content-Disposition: inline Sender: linux-pci-owner@vger.kernel.org To: Thierry Reding Cc: "linux-pci@vger.kernel.org" , Grant Likely , Michal Simek , Rob Herring , devicetree-discuss , "rob.herring@calxeda.com" , linuxppc-dev , Benjamin Herrenschmidt , Liviu Dudau List-Id: devicetree@vger.kernel.org On Thu, Dec 20, 2012 at 08:25:00AM +0000, Thierry Reding wrote: > On Wed, Dec 12, 2012 at 04:37:50PM +0000, Andrew Murray wrote: > [...] > > diff --git a/drivers/of/address.c b/drivers/of/address.c > [...] > > + start = of_get_property(node, "ranges", &rlen); > > + if (start == NULL) > > + return NULL; > > + > > + end = start + rlen; > > I'm currently rewriting large parts of the Tegra PCIe controller driver > and I'm trying to use this new API. This seems to work fine, except that > I think this line needs to be: > > end = start + rlen / sizeof(__be32); > > Otherwise we'll try to process 4 times as many ranges as there are. > > Thierry Good catch. Thanks for taking this on. Andrew Murray