Skip to contentSkip to conversation

dyn_array: remove one panic

PATCH Applied Yinghai Lu 2 participants 2 messages Sep 6, 2008

lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 dyn_array: remove one panic

Andrew said, we don't need duplicated panic.
because __alloc_bootmem already have that.

init/dyn_array.c +2 -4
index cf1e04c..778d9d5 100644
@@ -33,11 +33,9 @@ void __init pre_alloc_dyn_array(void)
 
 	/* allocate them all together */
 	max_align = max_t(unsigned long, max_align, PAGE_SIZE);
-	ptr = __alloc_bootmem_nopanic(total_size, max_align, 0);
-	if (!ptr)
-		panic("Can not alloc dyn_alloc\n");
-
+	ptr = __alloc_bootmem(total_size, max_align, 0);
 	phys = virt_to_phys(ptr);
+
 	for (daa = __dyn_array_start ; daa < __dyn_array_end; daa++) {
 		struct dyn_array *da = *daa;
 
Applied
#1 lore raw
Quoted 4 lines · Yinghai Lu

Andrew said, we don't need duplicated panic.
because __alloc_bootmem already have that.

applied to tip/irq/sparseirq, thanks.

Maybe some design documentation would be nice too, to point out that most of the pain we do here is because we dont have bootmem available as early as we need an already instantiated dyn-array based IRQ array.

So we try this mix of an abstraction of preallocated and post-allocated array, with pre-bootmem and post-bootmem behavior.

Ingo