diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-05-02 10:10:23 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-05-09 17:53:10 -0400 |
commit | ec105a42ac397366e05888ea96503ab3b57f79ad (patch) | |
tree | bc2c4b7ae174b8aa247d87c3768d835a90afc19b /drivers/media/video | |
parent | 7564f67d5b38eb814e67edd8ba0c70fd8eb475b6 (diff) |
V4L/DVB (11674): ivtv: fix incorrect bit tests
Found the coccinelle tool.
Thanks-to: Julia Lawall <julia@diku.dk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-ioctl.c | 5 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-irq.c | 2 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-yuv.c | 3 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtvfb.c | 3 |
4 files changed, 8 insertions, 5 deletions
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index 4a2d464f055e..c342a9fe983e 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -180,7 +180,7 @@ int ivtv_set_speed(struct ivtv *itv, int speed) | |||
180 | 180 | ||
181 | /* Wait for any DMA to finish */ | 181 | /* Wait for any DMA to finish */ |
182 | prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE); | 182 | prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE); |
183 | while (itv->i_flags & IVTV_F_I_DMA) { | 183 | while (test_bit(IVTV_F_I_DMA, &itv->i_flags)) { |
184 | got_sig = signal_pending(current); | 184 | got_sig = signal_pending(current); |
185 | if (got_sig) | 185 | if (got_sig) |
186 | break; | 186 | break; |
@@ -1710,7 +1710,8 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg) | |||
1710 | we are waiting unlock first and later lock again. */ | 1710 | we are waiting unlock first and later lock again. */ |
1711 | mutex_unlock(&itv->serialize_lock); | 1711 | mutex_unlock(&itv->serialize_lock); |
1712 | prepare_to_wait(&itv->event_waitq, &wait, TASK_INTERRUPTIBLE); | 1712 | prepare_to_wait(&itv->event_waitq, &wait, TASK_INTERRUPTIBLE); |
1713 | if ((itv->i_flags & (IVTV_F_I_EV_DEC_STOPPED|IVTV_F_I_EV_VSYNC)) == 0) | 1713 | if (!test_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags) && |
1714 | !test_bit(IVTV_F_I_EV_VSYNC, &itv->i_flags)) | ||
1714 | schedule(); | 1715 | schedule(); |
1715 | finish_wait(&itv->event_waitq, &wait); | 1716 | finish_wait(&itv->event_waitq, &wait); |
1716 | mutex_lock(&itv->serialize_lock); | 1717 | mutex_lock(&itv->serialize_lock); |
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c index 01c14d2b381a..cd9db0bf33bf 100644 --- a/drivers/media/video/ivtv/ivtv-irq.c +++ b/drivers/media/video/ivtv/ivtv-irq.c | |||
@@ -196,7 +196,7 @@ static int stream_enc_dma_append(struct ivtv_stream *s, u32 data[CX2341X_MBOX_MA | |||
196 | bytes_needed, s->name); | 196 | bytes_needed, s->name); |
197 | return -1; | 197 | return -1; |
198 | } | 198 | } |
199 | if (rc && !s->buffers_stolen && (s->s_flags & IVTV_F_S_APPL_IO)) { | 199 | if (rc && !s->buffers_stolen && test_bit(IVTV_F_S_APPL_IO, &s->s_flags)) { |
200 | IVTV_WARN("All %s stream buffers are full. Dropping data.\n", s->name); | 200 | IVTV_WARN("All %s stream buffers are full. Dropping data.\n", s->name); |
201 | IVTV_WARN("Cause: the application is not reading fast enough.\n"); | 201 | IVTV_WARN("Cause: the application is not reading fast enough.\n"); |
202 | } | 202 | } |
diff --git a/drivers/media/video/ivtv/ivtv-yuv.c b/drivers/media/video/ivtv/ivtv-yuv.c index 7912ed6b72ee..c0875378acc2 100644 --- a/drivers/media/video/ivtv/ivtv-yuv.c +++ b/drivers/media/video/ivtv/ivtv-yuv.c | |||
@@ -1063,7 +1063,8 @@ static int ivtv_yuv_udma_frame(struct ivtv *itv, struct ivtv_dma_frame *args) | |||
1063 | prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE); | 1063 | prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE); |
1064 | /* if no UDMA is pending and no UDMA is in progress, then the DMA | 1064 | /* if no UDMA is pending and no UDMA is in progress, then the DMA |
1065 | is finished */ | 1065 | is finished */ |
1066 | while (itv->i_flags & (IVTV_F_I_UDMA_PENDING | IVTV_F_I_UDMA)) { | 1066 | while (test_bit(IVTV_F_I_UDMA_PENDING, &itv->i_flags) || |
1067 | test_bit(IVTV_F_I_UDMA, &itv->i_flags)) { | ||
1067 | /* don't interrupt if the DMA is in progress but break off | 1068 | /* don't interrupt if the DMA is in progress but break off |
1068 | a still pending DMA. */ | 1069 | a still pending DMA. */ |
1069 | got_sig = signal_pending(current); | 1070 | got_sig = signal_pending(current); |
diff --git a/drivers/media/video/ivtv/ivtvfb.c b/drivers/media/video/ivtv/ivtvfb.c index 66e6eb513076..fa6bb85cb4b0 100644 --- a/drivers/media/video/ivtv/ivtvfb.c +++ b/drivers/media/video/ivtv/ivtvfb.c | |||
@@ -298,7 +298,8 @@ static int ivtvfb_prep_dec_dma_to_device(struct ivtv *itv, | |||
298 | prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE); | 298 | prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE); |
299 | /* if no UDMA is pending and no UDMA is in progress, then the DMA | 299 | /* if no UDMA is pending and no UDMA is in progress, then the DMA |
300 | is finished */ | 300 | is finished */ |
301 | while (itv->i_flags & (IVTV_F_I_UDMA_PENDING | IVTV_F_I_UDMA)) { | 301 | while (test_bit(IVTV_F_I_UDMA_PENDING, &itv->i_flags) || |
302 | test_bit(IVTV_F_I_UDMA, &itv->i_flags)) { | ||
302 | /* don't interrupt if the DMA is in progress but break off | 303 | /* don't interrupt if the DMA is in progress but break off |
303 | a still pending DMA. */ | 304 | a still pending DMA. */ |
304 | got_sig = signal_pending(current); | 305 | got_sig = signal_pending(current); |