Commit eca28743 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

ps3fb: atomic fixes

ps3fb: Use atomic_dec_if_positive() instead of bogus atomic_read()/atomic_dec()
combinations
Signed-off-by: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1c0c8461
...@@ -680,13 +680,10 @@ EXPORT_SYMBOL_GPL(ps3fb_wait_for_vsync); ...@@ -680,13 +680,10 @@ EXPORT_SYMBOL_GPL(ps3fb_wait_for_vsync);
void ps3fb_flip_ctl(int on) void ps3fb_flip_ctl(int on)
{ {
if (on) { if (on)
if (atomic_read(&ps3fb.ext_flip) > 0) { atomic_dec_if_positive(&ps3fb.ext_flip);
atomic_dec(&ps3fb.ext_flip); else
}
} else {
atomic_inc(&ps3fb.ext_flip); atomic_inc(&ps3fb.ext_flip);
}
} }
EXPORT_SYMBOL_GPL(ps3fb_flip_ctl); EXPORT_SYMBOL_GPL(ps3fb_flip_ctl);
...@@ -786,8 +783,7 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd, ...@@ -786,8 +783,7 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd,
case PS3FB_IOCTL_OFF: case PS3FB_IOCTL_OFF:
DPRINTK("PS3FB_IOCTL_OFF:\n"); DPRINTK("PS3FB_IOCTL_OFF:\n");
if (atomic_read(&ps3fb.ext_flip) > 0) atomic_dec_if_positive(&ps3fb.ext_flip);
atomic_dec(&ps3fb.ext_flip);
retval = 0; retval = 0;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment