@@ -781,7 +781,7 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
struct cx231xx_fh *fh = vq->priv_data;
struct cx231xx *dev = fh->dev;
- *size = (fh->dev->width * fh->dev->height * dev->format->depth + 7)>>3;
+ *size = fh->dev->width * fh->dev->height * ((dev->format->depth + 7) >> 3);
if (0 == *count)
*count = CX231XX_DEF_BUF;
@@ -835,8 +835,8 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
int rc = 0, urb_init = 0;
/* The only currently supported format is 16 bits/pixel */
- buf->vb.size = (fh->dev->width * fh->dev->height * dev->format->depth
- + 7) >> 3;
+ buf->vb.size = fh->dev->width * fh->dev->height *
+ ((dev->format->depth + 7) >> 3);
if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size)
return -EINVAL;
@@ -1000,11 +1000,12 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
f->fmt.pix.width = dev->width;
f->fmt.pix.height = dev->height;
f->fmt.pix.pixelformat = dev->format->fourcc;
- f->fmt.pix.bytesperline = (dev->width * dev->format->depth + 7) >> 3;
+ f->fmt.pix.bytesperline = dev->width * ((dev->format->depth + 7) >> 3);
f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * dev->height;
f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
f->fmt.pix.field = V4L2_FIELD_INTERLACED;
+ f->fmt.pix.priv = 0;
return 0;
}
@@ -1045,10 +1046,11 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
f->fmt.pix.width = width;
f->fmt.pix.height = height;
f->fmt.pix.pixelformat = fmt->fourcc;
- f->fmt.pix.bytesperline = (dev->width * fmt->depth + 7) >> 3;
+ f->fmt.pix.bytesperline = dev->width * ((fmt->depth + 7) >> 3);
f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * height;
f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
f->fmt.pix.field = V4L2_FIELD_INTERLACED;
+ f->fmt.pix.priv = 0;
return 0;
}