MLK-11911-1 mxc IPUv3: capture: Define div_ratio as type of int32_t
authorLiu Ying <Ying.Liu@freescale.com>
Thu, 26 Nov 2015 07:28:36 +0000 (15:28 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:17 +0000 (14:49 -0500)
commitb103e04a23f8b82969eb7e92d98106491062960b
tree59911a16fefb59c587d740467d4f930bdc76277e
parent279a87556b02692a8ee83879d50ca130d88886ec
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>
drivers/mxc/ipu3/ipu_capture.c