From: Andrew Jones Subject: [kvm-unit-tests PATCH v2 2/4] devicetree: don't cache #address/#size-cells Date: Wed, 11 May 2016 15:25:19 +0200 Message-ID: <1462973121-14548-3-git-send-email-drjones@redhat.com> References: <1462973121-14548-1-git-send-email-drjones@redhat.com> Cc: lvivier@redhat.com, thuth@redhat.com, pbonzini@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45324 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932558AbcEKNZa (ORCPT ); Wed, 11 May 2016 09:25:30 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 5950F46297 for ; Wed, 11 May 2016 13:25:30 +0000 (UTC) In-Reply-To: <1462973121-14548-1-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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); -- 2.4.11