Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261542AbVCUE0h (ORCPT ); Sun, 20 Mar 2005 23:26:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261543AbVCUE0g (ORCPT ); Sun, 20 Mar 2005 23:26:36 -0500 Received: from are.twiddle.net ([64.81.246.98]:44419 "EHLO are.twiddle.net") by vger.kernel.org with ESMTP id S261542AbVCUE0R (ORCPT ); Sun, 20 Mar 2005 23:26:17 -0500 Date: Sun, 20 Mar 2005 20:26:02 -0800 From: Richard Henderson To: Andrew Morton Cc: Dan Kegel , jbglaw@lug-owl.de, linux-kernel@vger.kernel.org, torvalds@osdl.org Subject: Re: 2.6.11.3 build problem in arch/alpha/kernel/srcons.c with gcc-4.0 Message-ID: <20050321042602.GA3795@twiddle.net> Mail-Followup-To: Andrew Morton , Dan Kegel , jbglaw@lug-owl.de, linux-kernel@vger.kernel.org, torvalds@osdl.org References: <423E238F.3030805@kegel.com> <20050320190352.65cc1396.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050320190352.65cc1396.akpm@osdl.org> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5383 Lines: 179 On Sun, Mar 20, 2005 at 07:03:52PM -0800, Andrew Morton wrote: > Dan Kegel wrote: > > > > Anyone with an alpha care to suggest a fix for this? > > > > arch/alpha/kernel/srmcons.c: In function 'srmcons_open': > > arch/alpha/kernel/srmcons.c:196: warning: 'srmconsp' may be used uninitialized in this function > > make[1]: *** [arch/alpha/kernel/srmcons.o] Error 1 > > make: *** [arch/alpha/kernel] Error 2 > > > > I get this when building the 2.6.11.3 kernel with a recent gcc-4.0 snapshot. > > > > It's beyond gcc's ability to figure out that the code is OK. Options would > be to disable -Werror, or to artificially initialise that variable. Fixed thus. Note that even with a _raw_read_trylock implementation, smp still doesn't work. Everything that init spawns dies immediately. I havn't had a chance to find out why yet... r~ You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.2289, 2005-03-20 12:29:41-08:00, rth@kanga.twiddle.home [ALPHA] Elimitate two warnings from gcc4. smp.c | 43 ------------------------------------------- srmcons.c | 27 ++++++++++----------------- 2 files changed, 10 insertions(+), 60 deletions(-) diff -Nru a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c --- a/arch/alpha/kernel/smp.c 2005-03-20 20:23:28 -08:00 +++ b/arch/alpha/kernel/smp.c 2005-03-20 20:23:28 -08:00 @@ -175,48 +175,6 @@ cpu_idle(); } - -/* - * Rough estimation for SMP scheduling, this is the number of cycles it - * takes for a fully memory-limited process to flush the SMP-local cache. - * - * We are not told how much cache there is, so we have to guess. - */ -static void __init -smp_tune_scheduling (int cpuid) -{ - struct percpu_struct *cpu; - unsigned long on_chip_cache; /* kB */ - unsigned long freq; /* Hz */ - unsigned long bandwidth = 350; /* MB/s */ - - cpu = (struct percpu_struct*)((char*)hwrpb + hwrpb->processor_offset - + cpuid * hwrpb->processor_size); - switch (cpu->type) - { - case EV45_CPU: - on_chip_cache = 16 + 16; - break; - - case EV5_CPU: - case EV56_CPU: - on_chip_cache = 8 + 8 + 96; - break; - - case PCA56_CPU: - on_chip_cache = 16 + 8; - break; - - case EV6_CPU: - case EV67_CPU: - default: - on_chip_cache = 64 + 64; - break; - } - - freq = hwrpb->cycle_freq ? : est_cycle_freq; -} - /* Wait until hwrpb->txrdy is clear for cpu. Return -1 on timeout. */ static int __init wait_for_txrdy (unsigned long cpumask) @@ -517,7 +475,6 @@ current_thread_info()->cpu = boot_cpuid; smp_store_cpu_info(boot_cpuid); - smp_tune_scheduling(boot_cpuid); smp_setup_percpu_timer(boot_cpuid); /* Nothing to do on a UP box, or when told not to. */ diff -Nru a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c --- a/arch/alpha/kernel/srmcons.c 2005-03-20 20:23:28 -08:00 +++ b/arch/alpha/kernel/srmcons.c 2005-03-20 20:23:28 -08:00 @@ -164,29 +164,22 @@ unsigned long flags; int retval = 0; - spin_lock_irqsave(&srmconsp_lock, flags); - - do { - if (srmconsp != NULL) { - *ps = srmconsp; - break; - } + if (srmconsp == NULL) { + spin_lock_irqsave(&srmconsp_lock, flags); srmconsp = kmalloc(sizeof(*srmconsp), GFP_KERNEL); - if (srmconsp == NULL) { + if (srmconsp == NULL) retval = -ENOMEM; - break; + else { + srmconsp->tty = NULL; + spin_lock_init(&srmconsp->lock); + init_timer(&srmconsp->timer); } - srmconsp->tty = NULL; - spin_lock_init(&srmconsp->lock); - init_timer(&srmconsp->timer); - - *ps = srmconsp; - } while(0); - - spin_unlock_irqrestore(&srmconsp_lock, flags); + spin_unlock_irqrestore(&srmconsp_lock, flags); + } + *ps = srmconsp; return retval; } =================================================================== This BitKeeper patch contains the following changesets: 1.2289 ## Wrapped with gzip_uu ## M'XL( $!,/D( [56[V_;-A#]+/X5!Q38FFV628KZY4XSH8D1KK%-F#@>'J\]^[>V6_@6@LU\919H#?PL=%F MXG$E?+,N\[P2OA3&QJ^:QL;'BZ868YLY?O=YS&_;$?4C9$\ON3:P:O]%YY3=J_D^4 M$ (\R^')V? M@82,8'2Y5Q6-7OA""'.,3AZA:?O>)3BWJA?I3?Z"*G>@#RND49R&PW0_0\O-^RN)C,R\ MNCVM2MD9UB_#4'" X8@&$8D?A5+ M7(FU*JT1[@J?S869M:I<67/,M%%=9D!W;MTLN(&?6@VE!EZM^4:#>] (Z;O