diff options
author | Liu Ying <Ying.Liu@freescale.com> | 2013-12-03 22:26:12 -0500 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:47:26 -0400 |
commit | 5afb4c19b64f44e1a0fdb3fd9f0eabd22e0c28d7 (patch) | |
tree | 44df8f595260bef30dc6f38ffb2914be5a3cf4fd /drivers/media | |
parent | 772125d555bb4b162f90508b0bd69702d0405904 (diff) |
ENGR00290635-1 mxc vout:Fix a build warning
This patch fixes the following build warning by allocating
a block of virtual memory to cache an instance of the structure
mxc_vout_output instead of using the stack frame.
drivers/media/platform/mxc/output/mxc_vout.c: In function ‘mxc_vidioc_s_crop’:
drivers/media/platform/mxc/output/mxc_vout.c:1529:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]
Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/mxc/output/mxc_vout.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/media/platform/mxc/output/mxc_vout.c b/drivers/media/platform/mxc/output/mxc_vout.c index a9f6305295fc..05b9d93f8cb5 100644 --- a/drivers/media/platform/mxc/output/mxc_vout.c +++ b/drivers/media/platform/mxc/output/mxc_vout.c | |||
@@ -1413,7 +1413,7 @@ static int mxc_vidioc_g_crop(struct file *file, void *fh, | |||
1413 | static int mxc_vidioc_s_crop(struct file *file, void *fh, | 1413 | static int mxc_vidioc_s_crop(struct file *file, void *fh, |
1414 | const struct v4l2_crop *crop) | 1414 | const struct v4l2_crop *crop) |
1415 | { | 1415 | { |
1416 | struct mxc_vout_output *vout = fh, pre_vout; | 1416 | struct mxc_vout_output *vout = fh, *pre_vout; |
1417 | struct v4l2_rect *b = &vout->crop_bounds; | 1417 | struct v4l2_rect *b = &vout->crop_bounds; |
1418 | struct v4l2_crop fix_up_crop; | 1418 | struct v4l2_crop fix_up_crop; |
1419 | int ret = 0; | 1419 | int ret = 0; |
@@ -1476,13 +1476,17 @@ static int mxc_vidioc_s_crop(struct file *file, void *fh, | |||
1476 | return 0; | 1476 | return 0; |
1477 | } | 1477 | } |
1478 | 1478 | ||
1479 | pre_vout = vmalloc(sizeof(*pre_vout)); | ||
1480 | if (!pre_vout) | ||
1481 | return -ENOMEM; | ||
1482 | |||
1479 | /* wait current work finish */ | 1483 | /* wait current work finish */ |
1480 | if (vout->vbq.streaming) | 1484 | if (vout->vbq.streaming) |
1481 | flush_workqueue(vout->v4l_wq); | 1485 | flush_workqueue(vout->v4l_wq); |
1482 | 1486 | ||
1483 | mutex_lock(&vout->task_lock); | 1487 | mutex_lock(&vout->task_lock); |
1484 | 1488 | ||
1485 | memcpy(&pre_vout, vout, sizeof(*vout)); | 1489 | memcpy(pre_vout, vout, sizeof(*vout)); |
1486 | 1490 | ||
1487 | if (vout->disp_support_windows) { | 1491 | if (vout->disp_support_windows) { |
1488 | vout->task.output.crop.pos.x = 0; | 1492 | vout->task.output.crop.pos.x = 0; |
@@ -1514,7 +1518,7 @@ static int mxc_vidioc_s_crop(struct file *file, void *fh, | |||
1514 | goto done; | 1518 | goto done; |
1515 | } | 1519 | } |
1516 | 1520 | ||
1517 | if (mxc_vout_need_fb_reconfig(vout, &pre_vout)) { | 1521 | if (mxc_vout_need_fb_reconfig(vout, pre_vout)) { |
1518 | ret = config_disp_output(vout); | 1522 | ret = config_disp_output(vout); |
1519 | if (ret < 0) | 1523 | if (ret < 0) |
1520 | v4l2_err(vout->vfd->v4l2_dev, | 1524 | v4l2_err(vout->vfd->v4l2_dev, |
@@ -1523,6 +1527,7 @@ static int mxc_vidioc_s_crop(struct file *file, void *fh, | |||
1523 | } | 1527 | } |
1524 | 1528 | ||
1525 | done: | 1529 | done: |
1530 | vfree(pre_vout); | ||
1526 | mutex_unlock(&vout->task_lock); | 1531 | mutex_unlock(&vout->task_lock); |
1527 | 1532 | ||
1528 | return ret; | 1533 | return ret; |
@@ -1626,7 +1631,11 @@ static int mxc_vidioc_s_ctrl(struct file *file, void *fh, | |||
1626 | struct v4l2_control *ctrl) | 1631 | struct v4l2_control *ctrl) |
1627 | { | 1632 | { |
1628 | int ret = 0; | 1633 | int ret = 0; |
1629 | struct mxc_vout_output *vout = fh, pre_vout; | 1634 | struct mxc_vout_output *vout = fh, *pre_vout; |
1635 | |||
1636 | pre_vout = vmalloc(sizeof(*pre_vout)); | ||
1637 | if (!pre_vout) | ||
1638 | return -ENOMEM; | ||
1630 | 1639 | ||
1631 | /* wait current work finish */ | 1640 | /* wait current work finish */ |
1632 | if (vout->vbq.streaming) | 1641 | if (vout->vbq.streaming) |
@@ -1634,7 +1643,7 @@ static int mxc_vidioc_s_ctrl(struct file *file, void *fh, | |||
1634 | 1643 | ||
1635 | mutex_lock(&vout->task_lock); | 1644 | mutex_lock(&vout->task_lock); |
1636 | 1645 | ||
1637 | memcpy(&pre_vout, vout, sizeof(*vout)); | 1646 | memcpy(pre_vout, vout, sizeof(*vout)); |
1638 | 1647 | ||
1639 | switch (ctrl->id) { | 1648 | switch (ctrl->id) { |
1640 | case V4L2_CID_ROTATE: | 1649 | case V4L2_CID_ROTATE: |
@@ -1677,7 +1686,7 @@ static int mxc_vidioc_s_ctrl(struct file *file, void *fh, | |||
1677 | goto done; | 1686 | goto done; |
1678 | } | 1687 | } |
1679 | 1688 | ||
1680 | if (mxc_vout_need_fb_reconfig(vout, &pre_vout)) { | 1689 | if (mxc_vout_need_fb_reconfig(vout, pre_vout)) { |
1681 | ret = config_disp_output(vout); | 1690 | ret = config_disp_output(vout); |
1682 | if (ret < 0) | 1691 | if (ret < 0) |
1683 | v4l2_err(vout->vfd->v4l2_dev, | 1692 | v4l2_err(vout->vfd->v4l2_dev, |
@@ -1686,6 +1695,7 @@ static int mxc_vidioc_s_ctrl(struct file *file, void *fh, | |||
1686 | } | 1695 | } |
1687 | 1696 | ||
1688 | done: | 1697 | done: |
1698 | vfree(pre_vout); | ||
1689 | mutex_unlock(&vout->task_lock); | 1699 | mutex_unlock(&vout->task_lock); |
1690 | 1700 | ||
1691 | return ret; | 1701 | return ret; |