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