Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
ec105a42 7564f67d

+8 -5
+3 -2
drivers/media/video/ivtv/ivtv-ioctl.c
··· 180 180 181 181 /* Wait for any DMA to finish */ 182 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 184 got_sig = signal_pending(current); 185 185 if (got_sig) 186 186 break; ··· 1710 1710 we are waiting unlock first and later lock again. */ 1711 1711 mutex_unlock(&itv->serialize_lock); 1712 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 1715 schedule(); 1715 1716 finish_wait(&itv->event_waitq, &wait); 1716 1717 mutex_lock(&itv->serialize_lock);
+1 -1
drivers/media/video/ivtv/ivtv-irq.c
··· 196 196 bytes_needed, s->name); 197 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 200 IVTV_WARN("All %s stream buffers are full. Dropping data.\n", s->name); 201 201 IVTV_WARN("Cause: the application is not reading fast enough.\n"); 202 202 }
+2 -1
drivers/media/video/ivtv/ivtv-yuv.c
··· 1063 1063 prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE); 1064 1064 /* if no UDMA is pending and no UDMA is in progress, then the DMA 1065 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 1068 /* don't interrupt if the DMA is in progress but break off 1068 1069 a still pending DMA. */ 1069 1070 got_sig = signal_pending(current);
+2 -1
drivers/media/video/ivtv/ivtvfb.c
··· 298 298 prepare_to_wait(&itv->dma_waitq, &wait, TASK_INTERRUPTIBLE); 299 299 /* if no UDMA is pending and no UDMA is in progress, then the DMA 300 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 303 /* don't interrupt if the DMA is in progress but break off 303 304 a still pending DMA. */ 304 305 got_sig = signal_pending(current);