lkml.org 
[lkml]   [2008]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 03/25] add dyn_array support
Date
Hi,

"Yinghai Lu" <yhlu.kernel@gmail.com> writes:

> On Sat, Aug 2, 2008 at 9:03 PM, Johannes Weiner <hannes@saeurebad.de> wrote:
>> Hi,
>>
>> Yinghai Lu <yhlu.kernel@gmail.com> writes:
>>
>>> could have crazy big arrays and allocate them in bootmem at init stage.
>>> also also to allocate array according to size we need to use to avoid wasting
>>> memory
>>> use CONFIG_HAVE_DYN_ARRAY to enable it or not
>>>
>>> usage:
>>>
>>> |static struct irq_desc irq_desc_init __initdata = {
>>> | .status = IRQ_DISABLED,
>>> | .chip = &no_irq_chip,
>>> | .handle_irq = handle_bad_irq,
>>> | .depth = 1,
>>> | .lock = __SPIN_LOCK_UNLOCKED(irq_desc->lock),
>>> |#ifdef CONFIG_SMP
>>> | .affinity = CPU_MASK_ALL
>>> |#endif
>>> |};
>>> |
>>> |static void __init init_work(void *data)
>>> |{
>>> | struct dyn_array *da = data;
>>> | struct irq_desc *desc;
>>> | int i;
>>> |
>>> | desc = *da->name;
>>
>> Where *da->name might be NULL...
>
> you can not pass compiling
>
> +#define DEFINE_DYN_ARRAY(nameX, sizeX, nrX, alignX, init_workX) \
> + static struct dyn_array __dyn_array_##nameX __initdata = \
> + { .name = (void **)&nameX,\

I didn't mean da->name. Please reread my email, including the part you
stripped off in the reply.

> + .size = sizeX,\
> + .nr = &nrX,\
> + .align = alignX,\
> + .init_work = init_workX,\
> + }; \
> + static struct dyn_array *__dyn_array_ptr_##nameX __used \
> + __attribute__((__section__(".dyn_array.init"))) = \
> + &__dyn_array_##nameX
> +
>
> YH

Hannes


\
 
 \ /
  Last update: 2008-08-03 06:59    [from the cache]
©2003-2011 Jasper Spaans