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

Re: [Xen-devel] [RFC 10/24] xen/dts: Remove device_get_reg call in process_memory_node



On Thu, 2013-08-22 at 14:54 +0100, Julien Grall wrote:
> On 08/22/2013 02:23 PM, Ian Campbell wrote:
> > On Fri, 2013-08-16 at 22:05 +0100, Julien Grall wrote:
> >> The function device_get_reg will be removed in a future patch.
> > 
> > Why? It appears to be a useful helper.
> 
> This helper is only used in few places and can be replaced by:
>       - dt_read_number because #address-cells and #size-cells have no meaning
>         - 2 consecutive call to dt_next_cell

It seemed like a helper for this case would remain useful, even if it
isn't exactly device_get_reg. Up to you though.

>         - dt_get_address
> 
> > 
> >>
> >> Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
> >> ---
> >>  xen/common/device_tree.c |    7 ++++---
> >>  1 file changed, 4 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> >> index 95635f0..ea01a5a 100644
> >> --- a/xen/common/device_tree.c
> >> +++ b/xen/common/device_tree.c
> >> @@ -385,7 +385,7 @@ static void __init process_memory_node(const void 
> >> *fdt, int node,
> >>      const struct fdt_property *prop;
> >>      int i;
> >>      int banks;
> >> -    const u32 *cell;
> >> +    const __be32 *cell;
> >>      paddr_t start, size;
> >>  
> >>      if ( address_cells < 1 || size_cells < 1 )
> >> @@ -402,12 +402,13 @@ static void __init process_memory_node(const void 
> >> *fdt, int node,
> >>          return;
> >>      }
> >>  
> >> -    cell = (const u32 *)prop->data;
> >> +    cell = (const __be32 *)prop->data;
> >>      banks = device_tree_nr_reg_ranges(prop, address_cells, size_cells);
> >>  
> >>      for ( i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++ 
> >> )
> >>      {
> >> -        device_tree_get_reg(&cell, address_cells, size_cells, &start, 
> >> &size);
> >> +        start = dt_next_cell(address_cells, &cell);
> >> +        size = dt_next_cell(size_cells, &cell);
> >>          early_info.mem.bank[early_info.mem.nr_banks].start = start;
> >>          early_info.mem.bank[early_info.mem.nr_banks].size = size;
> >>          early_info.mem.nr_banks++;
> > 
> > 
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.