From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Huth Subject: Re: [kvm-unit-tests PATCH v2 3/4] devicetree: remove unused globals Date: Wed, 11 May 2016 17:38:29 +0200 Message-ID: <573351F5.4010202@redhat.com> References: <1462973121-14548-1-git-send-email-drjones@redhat.com> <1462973121-14548-4-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]:60128 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932664AbcEKPih (ORCPT ); Wed, 11 May 2016 11:38:37 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 ABA09C02C6A7 for ; Wed, 11 May 2016 15:38:31 +0000 (UTC) In-Reply-To: <1462973121-14548-4-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 11.05.2016 15:25, Andrew Jones wrote: > root_nr_address_cells and root_nr_size_cells are unused, > thanks to the last two patches. Remove them, and tidy-up > dt_init while at it. > > Signed-off-by: Andrew Jones > --- > lib/devicetree.c | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) > > diff --git a/lib/devicetree.c b/lib/devicetree.c > index 2da7d22339a64..c091459a94e27 100644 > --- a/lib/devicetree.c > +++ b/lib/devicetree.c > @@ -8,7 +8,6 @@ > #include "devicetree.h" > > static const void *fdt; > -static u32 root_nr_address_cells, root_nr_size_cells; > > const void *dt_fdt(void) > { > @@ -278,21 +277,16 @@ int dt_get_default_console_node(void) > > int dt_init(const void *fdt_ptr) > { > - int root, ret; > + int ret; > > ret = fdt_check_header(fdt_ptr); > if (ret < 0) > return ret; > - fdt = fdt_ptr; > - > - root = fdt_path_offset(fdt, "/"); > - if (root < 0) > - return root; > > - ret = dt_get_nr_cells(root, &root_nr_address_cells, > - &root_nr_size_cells); > + ret = fdt_path_offset(fdt_ptr, "/"); That line is now only a sanity check, right? ... in case you respin, you could maybe add a comment here what this is good for. > if (ret < 0) > return ret; > > + fdt = fdt_ptr; > return 0; > } > Reviewed-by: Thomas Huth