aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-ioctl.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2008-08-22 20:03:11 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:36:53 -0400
commitb04bce476c57ac844962462ee4c813c44fa942cf (patch)
treefb08a484414e6e486fd31c59c8533c46fd4b1341 /drivers/media/video/cx18/cx18-ioctl.c
parent59ba2b002265f2e862aa7f0df3f13c09ea99c4da (diff)
V4L/DVB (8772): cx18: Convert cx18_queue buffers member to atomic_t
cx18: Convert cx18_queue buffers member to atomic_t. This allows safe concurrent access to check if a queue has data without having to acquire the queue spinlock. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-ioctl.c')
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index a7f839631d6a..5325c7aacaf3 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -731,7 +731,8 @@ static int cx18_log_status(struct file *file, void *fh)
731 continue; 731 continue;
732 CX18_INFO("Stream %s: status 0x%04lx, %d%% of %d KiB (%d buffers) in use\n", 732 CX18_INFO("Stream %s: status 0x%04lx, %d%% of %d KiB (%d buffers) in use\n",
733 s->name, s->s_flags, 733 s->name, s->s_flags,
734 (s->buffers - s->q_free.buffers) * 100 / s->buffers, 734 (s->buffers - atomic_read(&s->q_free.buffers))
735 * 100 / s->buffers,
735 (s->buffers * s->buf_size) / 1024, s->buffers); 736 (s->buffers * s->buf_size) / 1024, s->buffers);
736 } 737 }
737 CX18_INFO("Read MPEG/VBI: %lld/%lld bytes\n", 738 CX18_INFO("Read MPEG/VBI: %lld/%lld bytes\n",