All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Thomas Huth <thuth@redhat.com>, Andrew Jones <drjones@redhat.com>,
	kvm@vger.kernel.org
Cc: lvivier@redhat.com
Subject: Re: [kvm-unit-tests PATCH v2 3/4] devicetree: remove unused globals
Date: Wed, 11 May 2016 17:46:30 +0200	[thread overview]
Message-ID: <573353D6.6090105@redhat.com> (raw)
In-Reply-To: <573351F5.4010202@redhat.com>



On 11/05/2016 17:38, Thomas Huth wrote:
> 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 <drjones@redhat.com>
>> ---
>>  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.

I can do that like this:

diff --git a/lib/devicetree.c b/lib/devicetree.c
index c091459..b9f1d3d 100644
--- a/lib/devicetree.c
+++ b/lib/devicetree.c
@@ -283,6 +283,7 @@ int dt_init(const void *fdt_ptr)
 	if (ret < 0)
 		return ret;

+	/* Sanity check the path.  */
 	ret = fdt_path_offset(fdt_ptr, "/");
 	if (ret < 0)
 		return ret;


Andrew, is this okay?

Thanks,

Paolo

  reply	other threads:[~2016-05-11 15:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11 13:25 [kvm-unit-tests PATCH v2 0/4] devicetree: use correct #address/#size cells Andrew Jones
2016-05-11 13:25 ` [kvm-unit-tests PATCH v2 1/4] devicetree: translate with parent node's #address/size-cells Andrew Jones
2016-05-11 15:30   ` Thomas Huth
2016-05-11 13:25 ` [kvm-unit-tests PATCH v2 2/4] devicetree: don't cache #address/#size-cells Andrew Jones
2016-05-11 15:31   ` Thomas Huth
2016-05-11 13:25 ` [kvm-unit-tests PATCH v2 3/4] devicetree: remove unused globals Andrew Jones
2016-05-11 15:38   ` Thomas Huth
2016-05-11 15:46     ` Paolo Bonzini [this message]
2016-05-11 16:10       ` Andrew Jones
2016-05-11 13:25 ` [kvm-unit-tests PATCH v2 4/4] devicetree: dt_get_nr_cells output robustness Andrew Jones
2016-05-11 15:36   ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=573353D6.6090105@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=lvivier@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.