[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC 11/24] xen/dts: Remove device_get_reg call in process_cpu_node
The function device_get_reg will be removed in a future patch. Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx> --- xen/common/device_tree.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index ea01a5a..433fa37 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -420,21 +420,26 @@ static void __init process_cpu_node(const void *fdt, int node, u32 address_cells, u32 size_cells) { const struct fdt_property *prop; - const u32 *cell; - paddr_t start, size; - + u32 cpuid; + int len; - prop = fdt_get_property(fdt, node, "reg", NULL); + prop = fdt_get_property(fdt, node, "reg", &len); if ( !prop ) { early_printk("fdt: node `%s': missing `reg' property\n", name); return; } - cell = (const u32 *)prop->data; - device_tree_get_reg(&cell, address_cells, size_cells, &start, &size); + if ( len < sizeof (cpuid) ) + { + dt_printk("fdt: node `%s': `reg` property length is too short\n", + name); + return; + } + + cpuid = dt_read_number((const __be32 *)prop->data, 1); - cpumask_set_cpu(start, &cpu_possible_map); + cpumask_set_cpu(cpuid, &cpu_possible_map); } static void __init process_multiboot_node(const void *fdt, int node, -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |