Message ID | 1504631700-19358-2-git-send-email-mjaggi@caviumnetworks.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi, On 05/09/17 18:14, mjaggi@caviumnetworks.com wrote: > From: Manish Jaggi <mjaggi@cavium.com> > > add_to_host_its_list will update the host_its_list. This common > function to be invoked from gicv3_its_dt_init and gic_v3_its_acpi_probe. > > Signed-off-by: Manish Jaggi <mjaggi@cavium.com> Makes sense. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Cheers, Andre. > --- > xen/arch/arm/gic-v3-its.c | 32 ++++++++++++++++++++------------ > 1 file changed, 20 insertions(+), 12 deletions(-) > > diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c > index 2d36030..61a6452 100644 > --- a/xen/arch/arm/gic-v3-its.c > +++ b/xen/arch/arm/gic-v3-its.c > @@ -976,11 +976,29 @@ int gicv3_its_make_hwdom_dt_nodes(const struct domain *d, > return res; > } > > +/* Common function for adding to host_its_list */ > +static void add_to_host_its_list(paddr_t addr, paddr_t size, > + const struct dt_device_node *node) > +{ > + struct host_its *its_data; > + > + its_data = xzalloc(struct host_its); > + if ( !its_data ) > + panic("GICv3: Cannot allocate memory for ITS frame"); > + > + its_data->addr = addr; > + its_data->size = size; > + its_data->dt_node = node; > + > + printk("GICv3: Found ITS @0x%lx\n", addr); > + > + list_add_tail(&its_data->entry, &host_its_list); > +} > + > /* Scan the DT for any ITS nodes and create a list of host ITSes out of it. */ > void gicv3_its_dt_init(const struct dt_device_node *node) > { > const struct dt_device_node *its = NULL; > - struct host_its *its_data; > > /* > * Check for ITS MSI subnodes. If any, add the ITS register > @@ -996,17 +1014,7 @@ void gicv3_its_dt_init(const struct dt_device_node *node) > if ( dt_device_get_address(its, 0, &addr, &size) ) > panic("GICv3: Cannot find a valid ITS frame address"); > > - its_data = xzalloc(struct host_its); > - if ( !its_data ) > - panic("GICv3: Cannot allocate memory for ITS frame"); > - > - its_data->addr = addr; > - its_data->size = size; > - its_data->dt_node = its; > - > - printk("GICv3: Found ITS @0x%lx\n", addr); > - > - list_add_tail(&its_data->entry, &host_its_list); > + add_to_host_its_list(addr, size, its); > } > } > >
Hi Manish, On 05/09/17 18:14, mjaggi@caviumnetworks.com wrote: > From: Manish Jaggi <mjaggi@cavium.com> > > add_to_host_its_list will update the host_its_list. This common > function to be invoked from gicv3_its_dt_init and gic_v3_its_acpi_probe. > > Signed-off-by: Manish Jaggi <mjaggi@cavium.com> > --- > xen/arch/arm/gic-v3-its.c | 32 ++++++++++++++++++++------------ > 1 file changed, 20 insertions(+), 12 deletions(-) > > diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c > index 2d36030..61a6452 100644 > --- a/xen/arch/arm/gic-v3-its.c > +++ b/xen/arch/arm/gic-v3-its.c > @@ -976,11 +976,29 @@ int gicv3_its_make_hwdom_dt_nodes(const struct domain *d, > return res; > } > > +/* Common function for adding to host_its_list */ > +static void add_to_host_its_list(paddr_t addr, paddr_t size, > + const struct dt_device_node *node) The indentation looks wrong here. With that fixed: Acked-by: Julien Grall <julien.grall@arm.com> Cheers,
diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c index 2d36030..61a6452 100644 --- a/xen/arch/arm/gic-v3-its.c +++ b/xen/arch/arm/gic-v3-its.c @@ -976,11 +976,29 @@ int gicv3_its_make_hwdom_dt_nodes(const struct domain *d, return res; } +/* Common function for adding to host_its_list */ +static void add_to_host_its_list(paddr_t addr, paddr_t size, + const struct dt_device_node *node) +{ + struct host_its *its_data; + + its_data = xzalloc(struct host_its); + if ( !its_data ) + panic("GICv3: Cannot allocate memory for ITS frame"); + + its_data->addr = addr; + its_data->size = size; + its_data->dt_node = node; + + printk("GICv3: Found ITS @0x%lx\n", addr); + + list_add_tail(&its_data->entry, &host_its_list); +} + /* Scan the DT for any ITS nodes and create a list of host ITSes out of it. */ void gicv3_its_dt_init(const struct dt_device_node *node) { const struct dt_device_node *its = NULL; - struct host_its *its_data; /* * Check for ITS MSI subnodes. If any, add the ITS register @@ -996,17 +1014,7 @@ void gicv3_its_dt_init(const struct dt_device_node *node) if ( dt_device_get_address(its, 0, &addr, &size) ) panic("GICv3: Cannot find a valid ITS frame address"); - its_data = xzalloc(struct host_its); - if ( !its_data ) - panic("GICv3: Cannot allocate memory for ITS frame"); - - its_data->addr = addr; - its_data->size = size; - its_data->dt_node = its; - - printk("GICv3: Found ITS @0x%lx\n", addr); - - list_add_tail(&its_data->entry, &host_its_list); + add_to_host_its_list(addr, size, its); } }