Messages in this thread |  | | From | Pranith Kumar <> | Date | Tue, 21 Oct 2014 18:15:58 -0400 | Subject | Re: [PATCH] cmpxchg: Discard unnecessary cast to volatile |
| |
On Tue, Oct 21, 2014 at 11:48 AM, H. Peter Anvin <hpa@zytor.com> wrote: > On 10/21/2014 03:14 AM, Peter Zijlstra wrote: >> On Mon, Oct 20, 2014 at 04:22:27PM -0400, Pranith Kumar wrote: >>>> Generating a volatile pointer is really not necessary here. This is the only >>>> location where a volatile pointer is being generated for use in asm. >>>> >>>> This commit removes the unnecessary volatile pointer being created. >>>> >>>> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> >> >> Seems sane enough to me. >> > > However, it seems like unnecessary churn. Does the volatile hurt in any > way?
Removing 4 lines of unnecessary code seems to be worthwhile to me. Also, we reduce the unnecessary use of 'volatile' data types which IMHO makes this a good little clean up.
I am not sure if the use of volatile actually causes any loss of chances of optimization. I've tried to come up with cases where this happens and was unsuccessful.
-- Pranith
|  |