lines   = norm->vbi_v_stop - norm->vbi_v_start +1; 
lines   = norm->vbi_v_stop_0 - norm->vbi_v_start_0 +1; 
static int buffer_prepare(struct videobuf_queue *q,			  struct videobuf_buffer *vb,			  enum v4l2_field field){	struct saa7134_fh *fh   = q->priv_data;	struct saa7134_dev *dev = fh->dev;	struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb);	struct saa7134_tvnorm *norm = dev->tvnorm;	unsigned int lines, llength, size;	int err;	lines   = norm->vbi_v_stop - norm->vbi_v_start +1;	if (lines > VBI_LINE_COUNT)		lines = VBI_LINE_COUNT;#if 1	llength = VBI_LINE_LENGTH;#else	llength = (norm->h_stop - norm->h_start +1) * 2;	if (llength > VBI_LINE_LENGTH)		llength = VBI_LINE_LENGTH;#endif	size = lines * llength * 2;	if (0 != buf->vb.baddr  &&  buf->vb.bsize < size)		return -EINVAL;	if (buf->vb.size != size)		saa7134_dma_free(dev,buf);	if (STATE_NEEDS_INIT == buf->vb.state) {		buf->vb.width  = llength;		buf->vb.height = lines;		buf->vb.size   = size;		buf->pt        = &fh->pt_vbi;		err = videobuf_iolock(dev->pci,&buf->vb,NULL);		if (err)			goto oops;		err = saa7134_pgtable_build(dev->pci,buf->pt,					    buf->vb.dma.sglist,					    buf->vb.dma.sglen,					    saa7134_buffer_startpage(buf));		if (err)			goto oops;	}	buf->vb.state = STATE_PREPARED;	buf->activate = buffer_activate;	buf->vb.field = field;	return 0; oops:	saa7134_dma_free(dev,buf);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/f246a8172a9e403b78c34568f766990f1506a0ab/saa7134-vbi.c/buggy/drivers/media/video/saa7134/saa7134-vbi.c