Linux-kernel mailing list archive 2000-01,: RE: (*(unsigned long *)&jiffies)++;

# RE: (*(unsigned long *)&jiffies)++;

David Schwartz (davids@webmaster.com)
Thu, 6 Jan 2000 11:51:03 -0800

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Derrick J Brashear: "Re: HELP!!! Where is RARP?"
- Previous message: Magnus Danielson: "Re: Linux 2.4 before 2001?"
- In reply to: Benjamin Herrenschmidt: "Re: (*(unsigned long *)&jiffies)++;"

> On Thu, Jan 6, 2000, Andrea Arcangeli <andrea@suse.de> wrote:
>
> >>(*(unsigned long *)&jiffies)++;
> >>
> >>why not just jiffies++; ? It works fine with jiffies++ but I
> assume there
> >>is a reason...
> >
> >No reason. It won't make any difference.
> >
> >You could as well do jiffies++. jiffies is volatile so it can't be
> >reodered across other `;' and it won't be cached into registers.
>
> Actually, I'm wondering if the explicit may even kill the volatile
> attribute, thus allowing re-ordering... sounds bogus to me.

Exactly. What's the point of declaring it as volatile if you're later going
to cast the volatile away? The compiler has the right to ignore the fact
that it's volatile at that point.

DS

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: Derrick J Brashear: "Re: HELP!!! Where is RARP?"
- Previous message: Magnus Danielson: "Re: Linux 2.4 before 2001?"
- In reply to: Benjamin Herrenschmidt: "Re: (*(unsigned long *)&jiffies)++;"