aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/davinci
diff options
context:
space:
mode:
authorPrabhakar Lad <prabhakar.csengg@gmail.com>2014-07-18 12:31:51 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-21 23:46:17 -0400
commite9b5872ce5959298233ca43d03860eef85f4634f (patch)
treed1610cce47d07f17b007bb58abb509c0cb5a3b62 /drivers/media/platform/davinci
parent48f2650a87ae462598cf0a3b4b34ee5f52c34869 (diff)
[media] media: davinci: vpif: fix array out of bound warnings
This patch fixes following array out of bound warnings, drivers/media/platform/davinci/vpif_display.c: In function 'vpif_remove': drivers/media/platform/davinci/vpif_display.c:1389:36: warning: iteration 1u invokes undefined behavior [-Waggressive-loop-optimizations] vb2_dma_contig_cleanup_ctx(common->alloc_ctx); ^ drivers/media/platform/davinci/vpif_display.c:1385:2: note: containing loop for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) { ^ drivers/media/platform/davinci/vpif_capture.c: In function 'vpif_remove': drivers/media/platform/davinci/vpif_capture.c:1581:36: warning: iteration 1u invokes undefined behavior [-Waggressive-loop-optimizations] vb2_dma_contig_cleanup_ctx(common->alloc_ctx); ^ drivers/media/platform/davinci/vpif_capture.c:1577:2: note: containing loop for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) { ^ drivers/media/platform/davinci/vpif_capture.c:1580:23: warning: array subscript is above array bounds [-Warray-bounds] common = &ch->common[i]; Reported-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform/davinci')
-rw-r--r--drivers/media/platform/davinci/vpif_capture.c2
-rw-r--r--drivers/media/platform/davinci/vpif_display.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index 2f90f0d98ad5..3a85238afee3 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1577,7 +1577,7 @@ static int vpif_remove(struct platform_device *device)
1577 for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) { 1577 for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) {
1578 /* Get the pointer to the channel object */ 1578 /* Get the pointer to the channel object */
1579 ch = vpif_obj.dev[i]; 1579 ch = vpif_obj.dev[i];
1580 common = &ch->common[i]; 1580 common = &ch->common[VPIF_VIDEO_INDEX];
1581 vb2_dma_contig_cleanup_ctx(common->alloc_ctx); 1581 vb2_dma_contig_cleanup_ctx(common->alloc_ctx);
1582 /* Unregister video device */ 1582 /* Unregister video device */
1583 video_unregister_device(ch->video_dev); 1583 video_unregister_device(ch->video_dev);
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 0bd6dcb13cbc..6c6bd6b47994 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1385,7 +1385,7 @@ static int vpif_remove(struct platform_device *device)
1385 for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) { 1385 for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) {
1386 /* Get the pointer to the channel object */ 1386 /* Get the pointer to the channel object */
1387 ch = vpif_obj.dev[i]; 1387 ch = vpif_obj.dev[i];
1388 common = &ch->common[i]; 1388 common = &ch->common[VPIF_VIDEO_INDEX];
1389 vb2_dma_contig_cleanup_ctx(common->alloc_ctx); 1389 vb2_dma_contig_cleanup_ctx(common->alloc_ctx);
1390 /* Unregister video device */ 1390 /* Unregister video device */
1391 video_unregister_device(ch->video_dev); 1391 video_unregister_device(ch->video_dev);