How to avoid volatiles
Prabhakar Lad
prabhakar.csengg at gmail.com
Fri Oct 14 05:53:37 EDT 2011
Thanks Rohan.
Regards
--Prabhakar
On Fri, Oct 14, 2011 at 3:14 PM, rohan puri <rohan.puri15 at gmail.com> wrote:
>
>
> On Fri, Oct 14, 2011 at 2:51 PM, Prabhakar Lad <prabhakar.csengg at gmail.com
> > wrote:
>
>> Hi everyone,
>>
>> I had question in want eradicate volatile from here: for example:
>>
>>
>> #define 0x01c40800
>>
>>
>> if ((volatile void *)pllbase == (volatile void
>> *)DAVINCI_PLL_CNTRL0_BASE) /**HERE**/
>> return 8;
>> else
>> return pll_div(pllbase, PLLC_PREDIV);
>>
>>
>> Thanks.
>>
>>
>> Regards
>> --Prabhakar
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>> Hi,
>
> volatile keyword is make use of to enforce compiler that not to optimize
> the code that contains this qualifier.
>
> In this case maybe any of the two compared values could be changed in an
> unknowing way to the compiler which are to be considered and no optimization
> is required, hence volatile keyword is made use of.
>
> Regards,
> Rohan Puri
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111014/ff40cc6e/attachment.html
More information about the Kernelnewbies
mailing list