Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] media: vb2: change plane sizes array to unsigned int[]

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>

authored by

Marek Szyprowski and committed by
Mauro Carvalho Chehab
035aa147 25a27d91

+15 -15
+1 -1
drivers/media/video/atmel-isi.c
··· 249 249 Videobuf operations 250 250 ------------------------------------------------------------------*/ 251 251 static int queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, 252 - unsigned int *nplanes, unsigned long sizes[], 252 + unsigned int *nplanes, unsigned int sizes[], 253 253 void *alloc_ctxs[]) 254 254 { 255 255 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
+1 -1
drivers/media/video/marvell-ccic/mcam-core.c
··· 884 884 */ 885 885 886 886 static int mcam_vb_queue_setup(struct vb2_queue *vq, unsigned int *nbufs, 887 - unsigned int *num_planes, unsigned long sizes[], 887 + unsigned int *num_planes, unsigned int sizes[], 888 888 void *alloc_ctxs[]) 889 889 { 890 890 struct mcam_camera *cam = vb2_get_drv_priv(vq);
+1 -1
drivers/media/video/mem2mem_testdev.c
··· 739 739 */ 740 740 741 741 static int m2mtest_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, 742 - unsigned int *nplanes, unsigned long sizes[], 742 + unsigned int *nplanes, unsigned int sizes[], 743 743 void *alloc_ctxs[]) 744 744 { 745 745 struct m2mtest_ctx *ctx = vb2_get_drv_priv(vq);
+1 -1
drivers/media/video/mx3_camera.c
··· 191 191 */ 192 192 static int mx3_videobuf_setup(struct vb2_queue *vq, 193 193 unsigned int *count, unsigned int *num_planes, 194 - unsigned long sizes[], void *alloc_ctxs[]) 194 + unsigned int sizes[], void *alloc_ctxs[]) 195 195 { 196 196 struct soc_camera_device *icd = soc_camera_from_vb2q(vq); 197 197 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
+1 -1
drivers/media/video/pwc/pwc-if.c
··· 745 745 /* Videobuf2 operations */ 746 746 747 747 static int queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, 748 - unsigned int *nplanes, unsigned long sizes[], 748 + unsigned int *nplanes, unsigned int sizes[], 749 749 void *alloc_ctxs[]) 750 750 { 751 751 struct pwc_device *pdev = vb2_get_drv_priv(vq);
+1 -1
drivers/media/video/s5p-fimc/fimc-capture.c
··· 265 265 } 266 266 267 267 static int queue_setup(struct vb2_queue *vq, unsigned int *num_buffers, 268 - unsigned int *num_planes, unsigned long sizes[], 268 + unsigned int *num_planes, unsigned int sizes[], 269 269 void *allocators[]) 270 270 { 271 271 struct fimc_ctx *ctx = vq->drv_priv;
+1 -1
drivers/media/video/s5p-fimc/fimc-core.c
··· 692 692 } 693 693 694 694 static int fimc_queue_setup(struct vb2_queue *vq, unsigned int *num_buffers, 695 - unsigned int *num_planes, unsigned long sizes[], 695 + unsigned int *num_planes, unsigned int sizes[], 696 696 void *allocators[]) 697 697 { 698 698 struct fimc_ctx *ctx = vb2_get_drv_priv(vq);
+1 -1
drivers/media/video/s5p-mfc/s5p_mfc_dec.c
··· 745 745 }; 746 746 747 747 static int s5p_mfc_queue_setup(struct vb2_queue *vq, unsigned int *buf_count, 748 - unsigned int *plane_count, unsigned long psize[], 748 + unsigned int *plane_count, unsigned int psize[], 749 749 void *allocators[]) 750 750 { 751 751 struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv);
+1 -1
drivers/media/video/s5p-mfc/s5p_mfc_enc.c
··· 1514 1514 1515 1515 static int s5p_mfc_queue_setup(struct vb2_queue *vq, 1516 1516 unsigned int *buf_count, unsigned int *plane_count, 1517 - unsigned long psize[], void *allocators[]) 1517 + unsigned int psize[], void *allocators[]) 1518 1518 { 1519 1519 struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); 1520 1520
+1 -1
drivers/media/video/s5p-tv/mixer_video.c
··· 728 728 }; 729 729 730 730 static int queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, 731 - unsigned int *nplanes, unsigned long sizes[], 731 + unsigned int *nplanes, unsigned int sizes[], 732 732 void *alloc_ctxs[]) 733 733 { 734 734 struct mxr_layer *layer = vb2_get_drv_priv(vq);
+2 -2
drivers/media/video/sh_mobile_ceu_camera.c
··· 218 218 */ 219 219 static int sh_mobile_ceu_videobuf_setup(struct vb2_queue *vq, 220 220 unsigned int *count, unsigned int *num_planes, 221 - unsigned long sizes[], void *alloc_ctxs[]) 221 + unsigned int sizes[], void *alloc_ctxs[]) 222 222 { 223 223 struct soc_camera_device *icd = container_of(vq, struct soc_camera_device, vb2_vidq); 224 224 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); ··· 243 243 *count = pcdev->video_limit / PAGE_ALIGN(sizes[0]); 244 244 } 245 245 246 - dev_dbg(icd->parent, "count=%d, size=%lu\n", *count, sizes[0]); 246 + dev_dbg(icd->parent, "count=%d, size=%u\n", *count, sizes[0]); 247 247 248 248 return 0; 249 249 }
+1 -1
drivers/media/video/vivi.c
··· 651 651 Videobuf operations 652 652 ------------------------------------------------------------------*/ 653 653 static int queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, 654 - unsigned int *nplanes, unsigned long sizes[], 654 + unsigned int *nplanes, unsigned int sizes[], 655 655 void *alloc_ctxs[]) 656 656 { 657 657 struct vivi_dev *dev = vb2_get_drv_priv(vq);
+2 -2
include/media/videobuf2-core.h
··· 208 208 */ 209 209 struct vb2_ops { 210 210 int (*queue_setup)(struct vb2_queue *q, unsigned int *num_buffers, 211 - unsigned int *num_planes, unsigned long sizes[], 211 + unsigned int *num_planes, unsigned int sizes[], 212 212 void *alloc_ctxs[]); 213 213 214 214 void (*wait_prepare)(struct vb2_queue *q); ··· 273 273 wait_queue_head_t done_wq; 274 274 275 275 void *alloc_ctx[VIDEO_MAX_PLANES]; 276 - unsigned long plane_sizes[VIDEO_MAX_PLANES]; 276 + unsigned int plane_sizes[VIDEO_MAX_PLANES]; 277 277 278 278 unsigned int streaming:1; 279 279