buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); 
buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); 
static int restart_video_queue(struct cx8800_dev    *dev,			       struct cx88_dmaqueue *q){	struct cx88_core *core = dev->core;	struct cx88_buffer *buf, *prev;	struct list_head *item;	if (!list_empty(&q->active)) {	        buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);		dprintk(2,"restart_queue [%p/%d]: restart dma\n",			buf, buf->vb.i);		start_video_dma(dev, q, buf);		list_for_each(item,&q->active) {			buf = list_entry(item, struct cx88_buffer, vb.queue);			buf->count    = q->count++;		}		mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);		return 0;	}	prev = NULL;	for (;;) {		if (list_empty(&q->queued))			return 0;	        buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue);		if (NULL == prev) {			list_del(&buf->vb.queue);			list_add_tail(&buf->vb.queue,&q->active);			start_video_dma(dev, q, buf);			buf->vb.state = STATE_ACTIVE;			buf->count    = q->count++;			mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);			dprintk(2,"[%p/%d] restart_queue - first active\n",				buf,buf->vb.i);		} else if (prev->vb.width  == buf->vb.width  &&			   prev->vb.height == buf->vb.height &&			   prev->fmt       == buf->fmt) {			list_del(&buf->vb.queue);			list_add_tail(&buf->vb.queue,&q->active);			buf->vb.state = STATE_ACTIVE;			buf->count    = q->count++;			prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);			dprintk(2,"[%p/%d] restart_queue - move to active\n",				buf,buf->vb.i);		} else {			return 0;		}		prev = buf;	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4ac97914c6c35f6bf132071c718e034d0846b9f5/cx88-video.c/buggy/drivers/media/video/cx88/cx88-video.c