summaryrefslogtreecommitdiff
path: root/drivers/mxc
diff options
context:
space:
mode:
authorLiu Ying <Ying.Liu@freescale.com>2015-11-26 15:28:36 +0800
committerNitin Garg <nitin.garg@nxp.com>2016-01-14 11:02:26 -0600
commitd7686f21e2d81586f389fb28901ef6fd66ee6833 (patch)
tree7aa04589da39ee041fe507c942c37891fbb45a1d /drivers/mxc
parent1eef6198830e5ebea97995fd00f2d34ad682b848 (diff)
MLK-11911-1 mxc IPUv3: capture: Define div_ratio as type of int32_t
The local variable div_ratio could be less than zero, so let's define it as type of int32_t instead of uint32_t. This issue is reported by Coverity: Unsigned compared against 0 (NO_EFFECT) unsigned_compare: This less-than-zero comparison of an unsigned value is never true. div_ratio < 0U. if (div_ratio > 0xFF || div_ratio < 0) { dev_dbg(ipu->dev, "value of pixel_clk extends normal range\n"); return -EINVAL; } Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Diffstat (limited to 'drivers/mxc')
-rw-r--r--drivers/mxc/ipu3/ipu_capture.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mxc/ipu3/ipu_capture.c b/drivers/mxc/ipu3/ipu_capture.c
index 09bb6d98783b..f304c8140be4 100644
--- a/drivers/mxc/ipu3/ipu_capture.c
+++ b/drivers/mxc/ipu3/ipu_capture.c
@@ -43,7 +43,7 @@
int _ipu_csi_mclk_set(struct ipu_soc *ipu, uint32_t pixel_clk, uint32_t csi)
{
uint32_t temp;
- uint32_t div_ratio;
+ int32_t div_ratio;
div_ratio = (clk_get_rate(ipu->ipu_clk) / pixel_clk) - 1;