Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756032Ab0AMQio (ORCPT ); Wed, 13 Jan 2010 11:38:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755722Ab0AMQio (ORCPT ); Wed, 13 Jan 2010 11:38:44 -0500 Received: from hp3.statik.tu-cottbus.de ([141.43.120.68]:40718 "EHLO hp3.statik.tu-cottbus.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753196Ab0AMQin (ORCPT ); Wed, 13 Jan 2010 11:38:43 -0500 Message-ID: <4B4DF6B1.406@s5r6.in-berlin.de> Date: Wed, 13 Jan 2010 17:37:05 +0100 From: Stefan Richter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 MIME-Version: 1.0 To: Tilman Schmidt CC: Henrique de Moraes Holschuh , =?ISO-8859-1?Q?Ren=E9_?= =?ISO-8859-1?Q?Bolldorf?= , linux-kernel@vger.kernel.org Subject: Re: [Question] For what stand's __initdata, __devinit etc. ? References: <4B4CAA49.4090707@googlemail.com> <20100112234228.GA21777@khazad-dum.debian.net> <4B4DB0E3.9020707@imap.cc> In-Reply-To: <4B4DB0E3.9020707@imap.cc> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1802 Lines: 42 Tilman Schmidt wrote: > Am 2010-01-13 00:42 schrieb Henrique de Moraes Holschuh: >> On Tue, 12 Jan 2010, Ren? Bolldorf wrote: >>> Hi, >>> Do we really need this? >>> It will be nice if someone can me explain this. >> >> http://kernelnewbies.org/FAQ/InitExitMacros > > That's far from complete. It does not, for example, mention __devinit. This wiki contains also somewhat misleadingly worded text: "But why must you use these macros ?" This should read: "But why would you want to use these macros?" Answer: They are a micro-optimization which allows the kernel to free memory that was occupied by this code at some point, because that code won't be used after that point anymore. (In case of exit macros: These are hints to discard some code from a build in case of certain kernel configurations.) These macros only affect code which is statically linked into the kernel. Some macros, like for example __devinit, have so obscure uses and marginal benefits that a normal developer should not bother about them. __devinit in particular does not have any effect at all --- except if CONFIG_HOTPLUG is not defined. This may happen in configurations for embedded systems. But the majority of device drivers that you can find in the kernel tree are irrelevant (i.e. configured off) on such systems anyway. Some more information on these macros can be found in Corbet, Rubini, Kroah-Hartman: Linux Device Drivers, 3rd edition a.k.a. LDD3, which is also gratis available on the Web. -- Stefan Richter -=====-==-=- ---= -==-= http://arcgraph.de/sr/ -- 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/