[media] media: vb2: change plane sizes array to unsigned int[]
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 24 Aug 2011 09:43:36 +0000 (06:43 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 6 Sep 2011 18:04:27 +0000 (15:04 -0300)
Plane sizes array was declared as unsigned long[], while unsigned int is
more than enough for storing size of the video buffer. This patch reduces
the size of the array by definiting it as unsigned int[].

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 files changed:
drivers/media/video/atmel-isi.c
drivers/media/video/marvell-ccic/mcam-core.c
drivers/media/video/mem2mem_testdev.c
drivers/media/video/mx3_camera.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/s5p-fimc/fimc-capture.c
drivers/media/video/s5p-fimc/fimc-core.c
drivers/media/video/s5p-mfc/s5p_mfc_dec.c
drivers/media/video/s5p-mfc/s5p_mfc_enc.c
drivers/media/video/s5p-tv/mixer_video.c
drivers/media/video/sh_mobile_ceu_camera.c
drivers/media/video/vivi.c
include/media/videobuf2-core.h

index 7b89f00501b827efc52aee371eede35ef5d37b31..5a4b2d79ddd81e1e77853854c9f494441f1a1834 100644 (file)
@@ -249,7 +249,7 @@ static int atmel_isi_wait_status(struct atmel_isi *isi, int wait_reset)
        Videobuf operations
    ------------------------------------------------------------------*/
 static int queue_setup(struct vb2_queue *vq, unsigned int *nbuffers,
-                               unsigned int *nplanes, unsigned long sizes[],
+                               unsigned int *nplanes, unsigned int sizes[],
                                void *alloc_ctxs[])
 {
        struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
index 83c14514cd52c5db2fce764c420506ed02c687a2..744cf372e27dc89c2fbdcb4a524c9470911b8cfd 100644 (file)
@@ -884,7 +884,7 @@ static int mcam_read_setup(struct mcam_camera *cam)
  */
 
 static int mcam_vb_queue_setup(struct vb2_queue *vq, unsigned int *nbufs,
-               unsigned int *num_planes, unsigned long sizes[],
+               unsigned int *num_planes, unsigned int sizes[],
                void *alloc_ctxs[])
 {
        struct mcam_camera *cam = vb2_get_drv_priv(vq);
index 166bf9349c10c03dacce418f452e7bdc64df168a..0d0c0d5ac3a4a1b29bca4501a1ac0187bef9c1f0 100644 (file)
@@ -739,7 +739,7 @@ static const struct v4l2_ioctl_ops m2mtest_ioctl_ops = {
  */
 
 static int m2mtest_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers,
-                               unsigned int *nplanes, unsigned long sizes[],
+                               unsigned int *nplanes, unsigned int sizes[],
                                void *alloc_ctxs[])
 {
        struct m2mtest_ctx *ctx = vb2_get_drv_priv(vq);
index c045b47803adfdca07328815b08c34ab009ea9e3..9ae778535f04fbf77cbd2a4d3f7a6ee5016ad207 100644 (file)
@@ -191,7 +191,7 @@ static void mx3_cam_dma_done(void *arg)
  */
 static int mx3_videobuf_setup(struct vb2_queue *vq,
                        unsigned int *count, unsigned int *num_planes,
-                       unsigned long sizes[], void *alloc_ctxs[])
+                       unsigned int sizes[], void *alloc_ctxs[])
 {
        struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
        struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
index 51ca3589b1b5987b7a19284613d8bc894376e982..a7e4f561c860ab65b894124313a3c9e1f16e7587 100644 (file)
@@ -745,7 +745,7 @@ static int pwc_video_mmap(struct file *file, struct vm_area_struct *vma)
 /* Videobuf2 operations */
 
 static int queue_setup(struct vb2_queue *vq, unsigned int *nbuffers,
-                               unsigned int *nplanes, unsigned long sizes[],
+                               unsigned int *nplanes, unsigned int sizes[],
                                void *alloc_ctxs[])
 {
        struct pwc_device *pdev = vb2_get_drv_priv(vq);
index 0d730e55605d02423a5f34aea359f1e5202416d0..e6afe5f5e24a59c45c1d6bde9901ede84e716355 100644 (file)
@@ -265,7 +265,7 @@ static unsigned int get_plane_size(struct fimc_frame *fr, unsigned int plane)
 }
 
 static int queue_setup(struct vb2_queue *vq, unsigned int *num_buffers,
-                      unsigned int *num_planes, unsigned long sizes[],
+                      unsigned int *num_planes, unsigned int sizes[],
                       void *allocators[])
 {
        struct fimc_ctx *ctx = vq->drv_priv;
index aa550666cc0bca77fe372cb93067fd0312c6d327..36d127f4faec99db5df1db2d226e407234a0f3e4 100644 (file)
@@ -692,7 +692,7 @@ static void fimc_job_abort(void *priv)
 }
 
 static int fimc_queue_setup(struct vb2_queue *vq, unsigned int *num_buffers,
-                           unsigned int *num_planes, unsigned long sizes[],
+                           unsigned int *num_planes, unsigned int sizes[],
                            void *allocators[])
 {
        struct fimc_ctx *ctx = vb2_get_drv_priv(vq);
index b2c5052a9c41f6533723c2e6da160bd095e3cc94..dbc94b877c8f62849d38d383beddca58b426a050 100644 (file)
@@ -745,7 +745,7 @@ static const struct v4l2_ioctl_ops s5p_mfc_dec_ioctl_ops = {
 };
 
 static int s5p_mfc_queue_setup(struct vb2_queue *vq, unsigned int *buf_count,
-                              unsigned int *plane_count, unsigned long psize[],
+                              unsigned int *plane_count, unsigned int psize[],
                               void *allocators[])
 {
        struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv);
index fee094a14f4c3c6ec5ccadbbc55211cf71b37a9d..019a9e79704a6d4e1470d45f0d300c705d92793c 100644 (file)
@@ -1514,7 +1514,7 @@ static int check_vb_with_fmt(struct s5p_mfc_fmt *fmt, struct vb2_buffer *vb)
 
 static int s5p_mfc_queue_setup(struct vb2_queue *vq,
                       unsigned int *buf_count, unsigned int *plane_count,
-                      unsigned long psize[], void *allocators[])
+                      unsigned int psize[], void *allocators[])
 {
        struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv);
 
index 43ac22f35bc715566dbd2960d35915b046026426..8bea0f3927fb8d898430c4eb93d7bb82cd9a0290 100644 (file)
@@ -728,7 +728,7 @@ static const struct v4l2_file_operations mxr_fops = {
 };
 
 static int queue_setup(struct vb2_queue *vq, unsigned int *nbuffers,
-       unsigned int *nplanes, unsigned long sizes[],
+       unsigned int *nplanes, unsigned int sizes[],
        void *alloc_ctxs[])
 {
        struct mxr_layer *layer = vb2_get_drv_priv(vq);
index e54089802b6b906027b36369984f126d9d8e8830..8298c89226b9ffe8a0b25917da368b0490a73971 100644 (file)
@@ -218,7 +218,7 @@ static int sh_mobile_ceu_soft_reset(struct sh_mobile_ceu_dev *pcdev)
  */
 static int sh_mobile_ceu_videobuf_setup(struct vb2_queue *vq,
                        unsigned int *count, unsigned int *num_planes,
-                       unsigned long sizes[], void *alloc_ctxs[])
+                       unsigned int sizes[], void *alloc_ctxs[])
 {
        struct soc_camera_device *icd = container_of(vq, struct soc_camera_device, vb2_vidq);
        struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
@@ -243,7 +243,7 @@ static int sh_mobile_ceu_videobuf_setup(struct vb2_queue *vq,
                        *count = pcdev->video_limit / PAGE_ALIGN(sizes[0]);
        }
 
-       dev_dbg(icd->parent, "count=%d, size=%lu\n", *count, sizes[0]);
+       dev_dbg(icd->parent, "count=%d, size=%u\n", *count, sizes[0]);
 
        return 0;
 }
index b3ae1ba97fc653602fb852c8f01bb92f97a0c6c7..cfe68325d659edf996778e6ce7ceb8a60253d9a5 100644 (file)
@@ -651,7 +651,7 @@ static void vivi_stop_generating(struct vivi_dev *dev)
        Videobuf operations
    ------------------------------------------------------------------*/
 static int queue_setup(struct vb2_queue *vq, unsigned int *nbuffers,
-                               unsigned int *nplanes, unsigned long sizes[],
+                               unsigned int *nplanes, unsigned int sizes[],
                                void *alloc_ctxs[])
 {
        struct vivi_dev *dev = vb2_get_drv_priv(vq);
index 984f2bae2578c6ceee553c07af4066d56991d607..5287e901e17b14fbe4984e1fdb78f0793eeecec6 100644 (file)
@@ -208,7 +208,7 @@ struct vb2_buffer {
  */
 struct vb2_ops {
        int (*queue_setup)(struct vb2_queue *q, unsigned int *num_buffers,
-                          unsigned int *num_planes, unsigned long sizes[],
+                          unsigned int *num_planes, unsigned int sizes[],
                           void *alloc_ctxs[]);
 
        void (*wait_prepare)(struct vb2_queue *q);
@@ -273,7 +273,7 @@ struct vb2_queue {
        wait_queue_head_t               done_wq;
 
        void                            *alloc_ctx[VIDEO_MAX_PLANES];
-       unsigned long                   plane_sizes[VIDEO_MAX_PLANES];
+       unsigned int                    plane_sizes[VIDEO_MAX_PLANES];
 
        unsigned int                    streaming:1;
 
This page took 0.03476 seconds and 5 git commands to generate.