summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2015-09-21 15:33:48 +0200
committerPhilipp Zabel <p.zabel@pengutronix.de>2015-10-30 17:13:47 +0100
commit9b6d0d33c848661c859ccee331b9d2c2ba74489b (patch)
tree1b8e7f42e4d7c8529ed0e14ccd86618c7e8c47de
parent3e8b2246c36f4a340febc97d140db5dd727bb3c6 (diff)
downloadblackbird-op-linux-9b6d0d33c848661c859ccee331b9d2c2ba74489b.tar.gz
blackbird-op-linux-9b6d0d33c848661c859ccee331b9d2c2ba74489b.zip
gpu: ipu-v3: fix div_ratio type
The variable can be negative. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
-rw-r--r--drivers/gpu/ipu-v3/ipu-csi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c
index 3bdb7058fcca..06631ac61b04 100644
--- a/drivers/gpu/ipu-v3/ipu-csi.c
+++ b/drivers/gpu/ipu-v3/ipu-csi.c
@@ -202,7 +202,7 @@ static int ipu_csi_set_testgen_mclk(struct ipu_csi *csi, u32 pixel_clk,
u32 ipu_clk)
{
u32 temp;
- u32 div_ratio;
+ int div_ratio;
div_ratio = (ipu_clk / pixel_clk) - 1;
OpenPOWER on IntegriCloud