From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Tue, 08 Apr 2008 02:17:36 +0000 Subject: Re: [kvm-ppc-devel] [PATCH] Add idle wait support for 44x platforms Message-Id: <200804080417.37272.arnd@arndb.de> List-Id: References: <7226bef216680748a503.1207262582@thinkpadL> <1207289558.6971.15.camel@thinkpadL> <20080404064741.69f8669b@zod.rchland.ibm.com> In-Reply-To: <20080404064741.69f8669b@zod.rchland.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linuxppc-dev@ozlabs.org Cc: kvm-ppc-devel@lists.sourceforge.net On Friday 04 April 2008, Josh Boyer wrote: > On Fri, 04 Apr 2008 01:12:38 -0500 > Jerone Young wrote: > > > > > > > +static int current_mode = 0; > > > > > > Leave this as: static int current_mode;, so it'll end up in the bss > > > > The problem here is that this defines the default case. Is there really > > a benefit having this in bss ? > > It's still defined to 0 if it's in the BSS, as that is all initialized > to 0. Actually, a static assignment to 0 has not caused the symbol to end up in .data for many gcc versions, it always goes into .bss now unless you assign it a value other than 0 or use explicit section attributes. Whether or not you write the "= 0" is purely stylistic sugar and does not have any impact the generated binary. Arnd <>< ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ kvm-ppc-devel mailing list kvm-ppc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.174]) by ozlabs.org (Postfix) with ESMTP id 0FB85DDE3A for ; Tue, 8 Apr 2008 12:31:16 +1000 (EST) From: Arnd Bergmann To: linuxppc-dev@ozlabs.org Subject: Re: [PATCH] Add idle wait support for 44x platforms Date: Tue, 8 Apr 2008 04:17:36 +0200 References: <7226bef216680748a503.1207262582@thinkpadL> <1207289558.6971.15.camel@thinkpadL> <20080404064741.69f8669b@zod.rchland.ibm.com> In-Reply-To: <20080404064741.69f8669b@zod.rchland.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Message-Id: <200804080417.37272.arnd@arndb.de> Cc: kvm-ppc-devel@lists.sourceforge.net List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Friday 04 April 2008, Josh Boyer wrote: > On Fri, 04 Apr 2008 01:12:38 -0500 > Jerone Young wrote: > > > > > > > +static int current_mode = 0; > > > > > > Leave this as: static int current_mode;, so it'll end up in the bss > > > > The problem here is that this defines the default case. Is there really > > a benefit having this in bss ? > > It's still defined to 0 if it's in the BSS, as that is all initialized > to 0. Actually, a static assignment to 0 has not caused the symbol to end up in .data for many gcc versions, it always goes into .bss now unless you assign it a value other than 0 or use explicit section attributes. Whether or not you write the "= 0" is purely stylistic sugar and does not have any impact the generated binary. Arnd <><