Re: [PATCH 4/8] i386: bitops: Kill volatile-casting of memory addresses

2007-07-24 Thread Nick Piggin
Linus Torvalds wrote: On Tue, 24 Jul 2007, Benjamin Herrenschmidt wrote: Besides, as Nick pointed out, it prevents some valid optimizations. No it doesn't. Not the ones on the functions that just do an inline asm. The only valid optimization it might break is for "constant_test_bit()", w

Re: [PATCH 4/8] i386: bitops: Kill volatile-casting of memory addresses

2007-07-24 Thread Jeff Garzik
Linus Torvalds wrote: And before we remove that "volatile", we'd better make damn sure that there isn't any driver that does /* Wait for the command queue to be cleared by DMA */ while (test_bit(...)) ; or similar. Yes, it's annoying, but this is a scary and su

Re: [PATCH 4/8] i386: bitops: Kill volatile-casting of memory addresses

2007-07-24 Thread Linus Torvalds
On Tue, 24 Jul 2007, Benjamin Herrenschmidt wrote: > > - This "volatile" will allow to pass pointers to volatile data to the > bitops. > > - Most users of "volatile" in the kenrel (except maybe jiffies) are > bogus > > - Thus let's remove it -as a type safety thing- to catch more of those >

Re: [PATCH 4/8] i386: bitops: Kill volatile-casting of memory addresses

2007-07-24 Thread Benjamin Herrenschmidt
> The "const volatile" is so that you can pass an arbitrary pointer. The > only kind of abritraty pointer is "const volatile". > > In other words, the "volatile" has nothing at all to do with whether the > memory is volatile or not (the same way "const" has nothing to do with it: > it's purely

Re: [PATCH 4/8] i386: bitops: Kill volatile-casting of memory addresses

2007-07-24 Thread Nick Piggin
Satyam Sharma wrote: On Tue, 24 Jul 2007, Nick Piggin wrote: Linus Torvalds wrote: Of course, if we remove all "volatiles" in data in the kernel (with the possible exception of "jiffies"), we can then remove them from function declarations too, but it should be done in that order. Well,

Re: [PATCH 4/8] i386: bitops: Kill volatile-casting of memory addresses

2007-07-23 Thread Satyam Sharma
On Tue, 24 Jul 2007, Nick Piggin wrote: > Linus Torvalds wrote: > > > > On Mon, 23 Jul 2007, Satyam Sharma wrote: > > > > > > > [4/8] i386: bitops: Kill volatile-casting of memory addresses > > > > > > This is wrong. > > > > The "const volatile" is so that you can pass an arbitrary pointer.

Re: [PATCH 4/8] i386: bitops: Kill volatile-casting of memory addresses

2007-07-23 Thread Nick Piggin
Linus Torvalds wrote: On Mon, 23 Jul 2007, Satyam Sharma wrote: [4/8] i386: bitops: Kill volatile-casting of memory addresses This is wrong. The "const volatile" is so that you can pass an arbitrary pointer. The only kind of abritraty pointer is "const volatile". In other words, the "v

Re: [PATCH 4/8] i386: bitops: Kill volatile-casting of memory addresses

2007-07-23 Thread Linus Torvalds
On Mon, 23 Jul 2007, Satyam Sharma wrote: > > [4/8] i386: bitops: Kill volatile-casting of memory addresses This is wrong. The "const volatile" is so that you can pass an arbitrary pointer. The only kind of abritraty pointer is "const volatile". In other words, the "volatile" has nothing at

[PATCH 4/8] i386: bitops: Kill volatile-casting of memory addresses

2007-07-23 Thread Satyam Sharma
From: Satyam Sharma <[EMAIL PROTECTED]> [4/8] i386: bitops: Kill volatile-casting of memory addresses All the occurrences of "volatile" that are used to qualify access to the passed bit-string pointer/address must be removed, because "volatile" is crazy, doesn't really work anyway, has nothing to