On Fri, Apr 07, 2017 at 10:15:07AM +0100, Will Deacon wrote:
> On Fri, Apr 07, 2017 at 02:37:36PM +0800, pierre Kuo wrote:
> > for below example, if MAX is defined to be 1, then the compiler knows (Q
> > % MAX) is equal to zero.
> > so compiler will transform the "else" part of code.
> >
> > q
On Fri, Apr 07, 2017 at 02:37:36PM +0800, pierre Kuo wrote:
> for below example, if MAX is defined to be 1, then the compiler knows (Q
> % MAX) is equal to zero.
> so compiler will transform the "else" part of code.
>
> q = READ_ONCE(a);
> if (q % MAX) {
> WRITE_ONCE(b, 1
for below example, if MAX is defined to be 1, then the compiler knows (Q
% MAX) is equal to zero.
so compiler will transform the "else" part of code.
q = READ_ONCE(a);
if (q % MAX) {
WRITE_ONCE(b, 1);
do_something();
} else {