From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Huth Subject: Re: [kvm-unit-tests PATCH v2 2/4] devicetree: don't cache #address/#size-cells Date: Wed, 11 May 2016 17:31:37 +0200 Message-ID: <57335059.8010407@redhat.com> References: <1462973121-14548-1-git-send-email-drjones@redhat.com> <1462973121-14548-3-git-send-email-drjones@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: lvivier@redhat.com, pbonzini@redhat.com To: Andrew Jones , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:58600 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751338AbcEKPbk (ORCPT ); Wed, 11 May 2016 11:31:40 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D2A7627FE for ; Wed, 11 May 2016 15:31:40 +0000 (UTC) In-Reply-To: <1462973121-14548-3-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 11.05.2016 15:25, Andrew Jones wrote: > The bus structure allows caching of #address/#size-cells. This > is an unnecessary complication, as we can always find that > information in the FDT (and don't care about the overhead). > Anyway, it's currently unused, so let's just remove the code. > > Signed-off-by: Andrew Jones > --- > lib/devicetree.c | 4 ---- > lib/devicetree.h | 5 ----- > 2 files changed, 9 deletions(-) > > diff --git a/lib/devicetree.c b/lib/devicetree.c > index 7859968c7a8d2..2da7d22339a64 100644 > --- a/lib/devicetree.c > +++ b/lib/devicetree.c > @@ -278,7 +278,6 @@ int dt_get_default_console_node(void) > > int dt_init(const void *fdt_ptr) > { > - struct dt_bus *defbus = (struct dt_bus *)&dt_default_bus; > int root, ret; > > ret = fdt_check_header(fdt_ptr); > @@ -295,8 +294,5 @@ int dt_init(const void *fdt_ptr) > if (ret < 0) > return ret; > > - defbus->nr_address_cells = root_nr_address_cells; > - defbus->nr_size_cells = root_nr_size_cells; > - > return 0; > } > diff --git a/lib/devicetree.h b/lib/devicetree.h > index d40243a603925..315ba948e7cc2 100644 > --- a/lib/devicetree.h > +++ b/lib/devicetree.h > @@ -66,9 +66,6 @@ struct dt_bus { > * - a negative FDT_ERR_* value on failure > */ > int (*translate)(const struct dt_device *dev, int regidx, void *reg); > - > - /* the bus #address-cells and #size-cells properties */ > - u32 nr_address_cells, nr_size_cells; > }; > > /* dt_bus_match_any matches any fdt node, i.e. it always returns true */ > @@ -125,8 +122,6 @@ static inline int dt_pbus_get_base(const struct dt_device *dev, > * dt_bus_init_defaults initializes @bus with > * match <- dt_bus_match_any > * translate <- dt_pbus_translate > - * nr_address_cells <- #address-cells of the root node > - * nr_size_cells <- #size-cells of the root node > */ > extern void dt_bus_init_defaults(struct dt_bus *bus); > > Reviewed-by: Thomas Huth