From: Andrzej Hajda Date: Mon, 21 Sep 2015 13:33:48 +0000 (+0200) Subject: gpu: ipu-v3: fix div_ratio type X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9b6d0d33c848661c859ccee331b9d2c2ba74489b;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: Philipp Zabel --- 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;