linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.4.5 gcc3 build patch
@ 2001-06-12 23:27 Richard Henderson
  2001-06-13  0:12 ` Andrea Arcangeli
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Henderson @ 2001-06-12 23:27 UTC (permalink / raw)
  To: torvalds, alan; +Cc: linux-kernel

We fixed a bug in cv-qualification checking.

timer.c:35: conflicting types for `xtime'
include/linux/sched.h:540: previous declaration of `xtime'

There's no need for the volatile qualification here.  One, being a
struct it doesn't do any good, and two it's protected by xtime_lock.


r~


--- kernel/timer.c.orig	Tue Jun 12 16:22:27 2001
+++ kernel/timer.c	Tue Jun 12 16:24:06 2001
@@ -32,7 +32,7 @@
 long tick = (1000000 + HZ/2) / HZ;	/* timer interrupt period */
 
 /* The current time */
-volatile struct timeval xtime __attribute__ ((aligned (16)));
+struct timeval xtime __attribute__ ((aligned (16)));
 
 /* Don't completely fail for HZ > 500.  */
 int tickadj = 500/HZ ? : 1;		/* microsecs */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 2.4.5 gcc3 build patch
  2001-06-12 23:27 2.4.5 gcc3 build patch Richard Henderson
@ 2001-06-13  0:12 ` Andrea Arcangeli
  0 siblings, 0 replies; 2+ messages in thread
From: Andrea Arcangeli @ 2001-06-13  0:12 UTC (permalink / raw)
  To: Richard Henderson; +Cc: torvalds, alan, linux-kernel

On Tue, Jun 12, 2001 at 04:27:33PM -0700, Richard Henderson wrote:
> We fixed a bug in cv-qualification checking.
> 
> timer.c:35: conflicting types for `xtime'
> include/linux/sched.h:540: previous declaration of `xtime'
> 
> There's no need for the volatile qualification here.  One, being a
> struct it doesn't do any good, and two it's protected by xtime_lock.

wrong, the sec field of xtime is read all the time without any lock.
so xtime can change under you it has to be declared volatile or C
language will screwup. gcc 3.0 effectively spotted a bug in the kernel
that wasn't exporting xtime as volatile.

Right fix is this that I did just about 10 minutes ago after the 3.0
checkout ;)

	ftp://ftp.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.6pre2aa2/00_gcc-30-volatile-xtime-1

Andrea

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-06-13  0:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-12 23:27 2.4.5 gcc3 build patch Richard Henderson
2001-06-13  0:12 ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).