Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755362AbYHCE4Q (ORCPT ); Sun, 3 Aug 2008 00:56:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751573AbYHCE4C (ORCPT ); Sun, 3 Aug 2008 00:56:02 -0400 Received: from saeurebad.de ([85.214.36.134]:60239 "EHLO saeurebad.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751425AbYHCE4B (ORCPT ); Sun, 3 Aug 2008 00:56:01 -0400 From: Johannes Weiner To: "Yinghai Lu" Cc: "Ingo Molnar" , "Thomas Gleixner" , "H. Peter Anvin" , "Eric W. Biederman" , "Dhaval Giani" , "Mike Travis" , "Andrew Morton" , linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/25] add dyn_array support References: <1217732365-16595-1-git-send-email-yhlu.kernel@gmail.com> <1217732365-16595-2-git-send-email-yhlu.kernel@gmail.com> <1217732365-16595-3-git-send-email-yhlu.kernel@gmail.com> <1217732365-16595-4-git-send-email-yhlu.kernel@gmail.com> <871w163fuw.fsf@saeurebad.de> <86802c440808022121u3dcdbda2s5ff463f4b330ca17@mail.gmail.com> Date: Sun, 03 Aug 2008 06:55:37 +0200 In-Reply-To: <86802c440808022121u3dcdbda2s5ff463f4b330ca17@mail.gmail.com> (Yinghai Lu's message of "Sat, 2 Aug 2008 21:21:14 -0700") Message-ID: <87sktm1yuu.fsf@saeurebad.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.1.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1980 Lines: 64 Hi, "Yinghai Lu" writes: > On Sat, Aug 2, 2008 at 9:03 PM, Johannes Weiner wrote: >> Hi, >> >> Yinghai Lu 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/