patches/linux/2.6.11.3/100-arch_alpha_kernel_srcons.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 23 17:08:09 2007 +0000 (2007-09-23)
changeset 402 197e1b49586e
permissions -rw-r--r--
Renamed all patches file names so that locales are now irrelevant to sort the files.
Removed the locale check as it is now irrelevant.
Removed the experimental binutils 2.17.50.0.xx: 2.18 is here now.
     1 Date: Sun, 20 Mar 2005 20:26:02 -0800
     2 From: Richard Henderson <rth@twiddle.net>
     3 To: Andrew Morton <akpm@osdl.org>
     4 Cc: Dan Kegel <dank@kegel.com>, jbglaw@lug-owl.de,
     5         linux-kernel@vger.kernel.org, torvalds@osdl.org
     6 Subject: Re: 2.6.11.3 build problem in arch/alpha/kernel/srcons.c with gcc-4.0
     7 Message-ID: <20050321042602.GA3795@twiddle.net>
     8 Mail-Followup-To: Andrew Morton <akpm@osdl.org>, Dan Kegel <dank@kegel.com>,
     9 	jbglaw@lug-owl.de, linux-kernel@vger.kernel.org, torvalds@osdl.org
    10 References: <423E238F.3030805@kegel.com> <20050320190352.65cc1396.akpm@osdl.org>
    11 Mime-Version: 1.0
    12 Content-Type: text/plain; charset=us-ascii
    13 Content-Disposition: inline
    14 In-Reply-To: <20050320190352.65cc1396.akpm@osdl.org>
    15 User-Agent: Mutt/1.4.1i
    16 
    17 On Sun, Mar 20, 2005 at 07:03:52PM -0800, Andrew Morton wrote:
    18 > Dan Kegel <dank@kegel.com> wrote:
    19 > >
    20 > > Anyone with an alpha care to suggest a fix for this?
    21 > > 
    22 > > arch/alpha/kernel/srmcons.c: In function 'srmcons_open':
    23 > > arch/alpha/kernel/srmcons.c:196: warning: 'srmconsp' may be used uninitialized in this function
    24 > > make[1]: *** [arch/alpha/kernel/srmcons.o] Error 1
    25 > > make: *** [arch/alpha/kernel] Error 2
    26 > > 
    27 > > I get this when building the 2.6.11.3 kernel with a recent gcc-4.0 snapshot.
    28 > > 
    29 > 
    30 > It's beyond gcc's ability to figure out that the code is OK.  Options would
    31 > be to disable -Werror, or to artificially initialise that variable.
    32 
    33 Fixed thus.
    34 
    35 Note that even with a _raw_read_trylock implementation, smp still
    36 doesn't work.  Everything that init spawns dies immediately.  I
    37 havn't had a chance to find out why yet...
    38 
    39 [ Note: deleted changes to smp.c, since they didn't apply cleanly
    40   to 2.6.11.3 (the function had moved, I guess), and they seemed unrelated.]
    41 
    42 r~
    43 
    44 
    45 
    46 You can import this changeset into BK by piping this whole message to:
    47 '| bk receive [path to repository]' or apply the patch as usual.
    48 
    49 ===================================================================
    50 
    51 
    52 ChangeSet@1.2289, 2005-03-20 12:29:41-08:00, rth@kanga.twiddle.home
    53   [ALPHA] Elimitate two warnings from gcc4.
    54 
    55 
    56  smp.c     |   43 -------------------------------------------
    57  srmcons.c |   27 ++++++++++-----------------
    58  2 files changed, 10 insertions(+), 60 deletions(-)
    59 
    60 
    61 diff -Nru a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c
    62 --- a/arch/alpha/kernel/srmcons.c	2005-03-20 20:23:28 -08:00
    63 +++ b/arch/alpha/kernel/srmcons.c	2005-03-20 20:23:28 -08:00
    64 @@ -164,29 +164,22 @@
    65  	unsigned long flags;
    66  	int retval = 0;
    67  
    68 -	spin_lock_irqsave(&srmconsp_lock, flags);
    69 -
    70 -	do {
    71 -		if (srmconsp != NULL) {
    72 -			*ps = srmconsp;
    73 -			break;
    74 -		}
    75 +	if (srmconsp == NULL) {
    76 +		spin_lock_irqsave(&srmconsp_lock, flags);
    77  
    78  		srmconsp = kmalloc(sizeof(*srmconsp), GFP_KERNEL);
    79 -		if (srmconsp == NULL) {
    80 +		if (srmconsp == NULL)
    81  			retval = -ENOMEM;
    82 -			break;
    83 +		else {
    84 +			srmconsp->tty = NULL;
    85 +			spin_lock_init(&srmconsp->lock);
    86 +			init_timer(&srmconsp->timer);
    87  		}
    88  
    89 -		srmconsp->tty = NULL;
    90 -		spin_lock_init(&srmconsp->lock);
    91 -		init_timer(&srmconsp->timer);
    92 -
    93 -		*ps = srmconsp;
    94 -	} while(0);
    95 -
    96 -	spin_unlock_irqrestore(&srmconsp_lock, flags);
    97 +		spin_unlock_irqrestore(&srmconsp_lock, flags);
    98 +	}
    99  
   100 +	*ps = srmconsp;
   101  	return retval;
   102  }
   103  
   104 
   105 ===================================================================
   106 
   107 
   108 This BitKeeper patch contains the following changesets:
   109 1.2289
   110 ## Wrapped with gzip_uu ##
   111 
   112 
   113 M'XL( $!,/D(  [56[V_;-A#]+/X5!Q38FFV628KZY<!!TJ98BP9;D"&?BL)@
   114 M),H6+%$:2=DQIOWO)>4XSH8D1KK%-F#@>'J\]^[>V6_@6@LU\919H#?PL=%F
   115 MXG$E?+,N\[P2OA3&QJ^:QL;'BZ868YLY?O=YS&_;$?4C9$\ON<D6L!)*3SSB
   116 M!_<1LVG%Q+OZ\.OUQ=D50M,IO%]P.1=_" /3*3*-6O$JUZ?<+*I&^D9QJ6MA
   117 MN)\U=7^?VE.,J7V') YP&/4DPBSN,Y(3PAD1.:8LB=@>3:P:O]%YY3=J_D^4
   118 M$ <DH4&0!LRBL"A YT!\2I,4<#C&P9AB('1"TPDC(YQ,, 9+]G1I(?B]($X#
   119 M^)G""*-W\/]2>(\R^')V<?GQ["M\J,JZ--P(,.L&UES)4LXU%*JI89YES$>?
   120 M@82,8'2Y5Q6-7OA""'.,3AZA:?O><Y4MQKQJ%WR\%$J*:JQ5G352^YEC%&!"
   121 ML664!%%/+:^PCW-:I 7)XUSDE*;Q$_(= K9]<FK1E(0]HPPS6^'S2C\"6+=;
   122 ML#O=&::T#^*8QGU*;D@>)3BWJA?I3?Z"*G>@#RND49R&PW0_0\O-^RN)C,R\
   123 MNCVM2MD9U<CRUL_%EYU:7P]+32@A$644]RQ,*!TL0>B_#4'" X8@&$8D?A5+
   124 M7(FU*JT1[@J?S869M:I<67/,M%%=9D!W;MTLN(&?6@VE!EZM^4:#>] (Z<RR
   125 M':3?8:36P\<._^5S'?L.+YV3*(88?;*4@"*O+.#M'5QK^P^_75]<',%?R/-T
   126 M6\I9U63+6:G^U'PEWOZP2QS"OT!1\;D^.K:0<03$0;HO[W%,EY5LLQ)@-DM4
   127 M6@P7>;O<T8DQ&]CF'P\'^Q)D:?;WCTY<\&C(<2<S4]9"/3P? D-I"8'$7IHD
   128 MCNT6L9,[6DIH.PI/,_/^=H^FCI7KV737WO;X*2\Y\QW^W?A/JP#==')YJDVG
   129 M+=HA'SU8!H1AS!@-^X"F=LJ<AT+R8@]9"['@52QT+BKA'%2W,]-):YML(?+.
   130 M[HSY,90&\D9H^:,!GIF.5]4&6J&*1M7 Y08Z+8JNLB!%)S-3-M)%:]M:YZKM
   131 I\COL*J?5=SG*3;1=2J%3<?]?PY:?+7573PFE(L5)@+X!A'U=W,@(    
   132  
   133 
   134