From: Julien Grall Date: Wed, 1 Jul 2015 11:01:09 +0000 (+0100) Subject: xen/arm: gic: Allow the base address to be 0 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2961 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c1fde0dcd4ecb78378ffe8b3e263d28dc3b9c0eb;p=xen.git 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 Acked-by: Ian Campbell Cc: Zoltan Kiss --- diff --git a/xen/arch/arm/gic-hip04.c b/xen/arch/arm/gic-hip04.c index 0ba15d1477..1b9d35e02e 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 f49ecd8ecb..5d0eb830f3 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 90cfa73899..1c38c0206e 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;