[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 10/15] xen/arm: gic: Allow the base address to be 0
0 is a valid physical address and dt_device_get_address would return an error if a problem during the retrieving happen. Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> Cc: Zoltan Kiss <zoltan.kiss@xxxxxxxxxx> --- Changes in v2: - Add Ian's acked - Merge "xen/arm: gic-v2: Allow the base address to be 0" and "xen/arm: gic-hip04: Allow the base address to be 0" in a single patch. - Remove the check in gicv3 too --- xen/arch/arm/gic-hip04.c | 8 ++++---- xen/arch/arm/gic-v2.c | 8 ++++---- xen/arch/arm/gic-v3.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/xen/arch/arm/gic-hip04.c b/xen/arch/arm/gic-hip04.c index 0ba15d1..1b9d35e 100644 --- a/xen/arch/arm/gic-hip04.c +++ b/xen/arch/arm/gic-hip04.c @@ -680,19 +680,19 @@ static int __init hip04gic_init(void) const struct dt_device_node *node = gicv2_info.node; res = dt_device_get_address(node, 0, &gicv2.dbase, NULL); - if ( res || !gicv2.dbase ) + if ( res ) panic("GIC-HIP04: Cannot find a valid address for the distributor"); res = dt_device_get_address(node, 1, &gicv2.cbase, NULL); - if ( res || !gicv2.cbase ) + if ( res ) panic("GIC-HIP04: Cannot find a valid address for the CPU"); res = dt_device_get_address(node, 2, &gicv2.hbase, NULL); - if ( res || !gicv2.hbase ) + if ( res ) panic("GIC-HIP04: Cannot find a valid address for the hypervisor"); res = dt_device_get_address(node, 3, &gicv2.vbase, NULL); - if ( res || !gicv2.vbase ) + if ( res ) panic("GIC-HIP04: Cannot find a valid address for the virtual CPU"); res = platform_get_irq(node, 0); diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c index f49ecd8..5d0eb83 100644 --- a/xen/arch/arm/gic-v2.c +++ b/xen/arch/arm/gic-v2.c @@ -666,19 +666,19 @@ static int __init gicv2_init(void) const struct dt_device_node *node = gicv2_info.node; res = dt_device_get_address(node, 0, &gicv2.dbase, NULL); - if ( res || !gicv2.dbase ) + if ( res ) panic("GICv2: Cannot find a valid address for the distributor"); res = dt_device_get_address(node, 1, &gicv2.cbase, NULL); - if ( res || !gicv2.cbase ) + if ( res ) panic("GICv2: Cannot find a valid address for the CPU"); res = dt_device_get_address(node, 2, &gicv2.hbase, NULL); - if ( res || !gicv2.hbase ) + if ( res ) panic("GICv2: Cannot find a valid address for the hypervisor"); res = dt_device_get_address(node, 3, &gicv2.vbase, NULL); - if ( res || !gicv2.vbase ) + if ( res ) panic("GICv2: Cannot find a valid address for the virtual CPU"); res = platform_get_irq(node, 0); diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 90cfa73..1c38c02 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1198,7 +1198,7 @@ static int __init gicv3_init(void) } res = dt_device_get_address(node, 0, &gicv3.dbase, NULL); - if ( res || !gicv3.dbase ) + if ( res ) panic("GICv3: Cannot find a valid distributor address"); if ( (gicv3.dbase & ~PAGE_MASK) ) @@ -1230,7 +1230,7 @@ static int __init gicv3_init(void) uint64_t rdist_base, rdist_size; res = dt_device_get_address(node, 1 + i, &rdist_base, &rdist_size); - if ( res || !rdist_base ) + if ( res ) panic("GICv3: No rdist base found for region %d\n", i); rdist_regs[i].base = rdist_base; -- 2.4.3 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |