const struct bttv_format *fmt, 
const struct bttv_format *fmt, 
static int bttv_prepare_buffer(struct bttv *btv, struct bttv_buffer *buf, 			       const struct bttv_format *fmt,			       unsigned int width, unsigned int height,			       enum v4l2_field field){	int redo_dma_risc = 0;	int rc;	/* check settings */	if (NULL == fmt)		return -EINVAL;	if (fmt->btformat == BT848_COLOR_FMT_RAW) {		width  = RAW_BPL;		height = RAW_LINES*2;		if (width*height > buf->vb.bsize)			return -EINVAL;		buf->vb.size = buf->vb.bsize;	} else {		if (width  < 48 ||		    height < 32 ||		    width  > bttv_tvnorms[btv->tvnorm].swidth ||		    height > bttv_tvnorms[btv->tvnorm].sheight)			return -EINVAL;		buf->vb.size = (width * height * fmt->depth) >> 3;		if (0 != buf->vb.baddr  &&  buf->vb.bsize < buf->vb.size)			return -EINVAL;	}	/* alloc + fill struct bttv_buffer (if changed) */	if (buf->vb.width != width || buf->vb.height != height ||	    buf->vb.field != field ||	    buf->tvnorm != btv->tvnorm || buf->fmt != fmt) {		buf->vb.width  = width;		buf->vb.height = height;		buf->vb.field  = field;		buf->tvnorm    = btv->tvnorm;		buf->fmt       = fmt;		redo_dma_risc = 1;	}	/* alloc risc memory */	if (STATE_NEEDS_INIT == buf->vb.state) {		redo_dma_risc = 1;		if (0 != (rc = videobuf_iolock(btv->c.pci,&buf->vb,&btv->fbuf)))			goto fail;	}	if (redo_dma_risc)		if (0 != (rc = bttv_buffer_risc(btv,buf)))			goto fail;	buf->vb.state = STATE_PREPARED;	return 0; fail:	bttv_dma_free(btv,buf);	return rc;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4ac97914c6c35f6bf132071c718e034d0846b9f5/bttv-driver.c/buggy/drivers/media/video/bttv-driver.c