Re: [kvm-unit-tests PATCH v2 3/4] devicetree: remove unused globals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxx>
>> ---
>>  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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux