summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rockchip
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2016-01-14 09:59:02 +0100
committerMark Yao <mark.yao@rock-chips.com>2016-01-18 08:43:16 +0800
commit484bb6c969523aa547d854bb57104339ee4aa800 (patch)
treed08bb42e449d974fff215143a14cbba09017cb7f /drivers/gpu/drm/rockchip
parentc7647f8681feeb6c0957e3cf5daed1fbf8b3a5af (diff)
downloadlinux-0-day-484bb6c969523aa547d854bb57104339ee4aa800.tar.gz
linux-0-day-484bb6c969523aa547d854bb57104339ee4aa800.tar.xz
drm/rockchip/dsi: fix handling mipi_dsi_pixel_format_to_bpp result
The function can return negative value so it should be assigned to signed variable. The problem has been detected using patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Chris Zhong <zyw@rock-chips.com>
Diffstat (limited to 'drivers/gpu/drm/rockchip')
-rw-r--r--drivers/gpu/drm/rockchip/dw-mipi-dsi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
index 7bfe243c61737..f8f8f29fb7c33 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
@@ -461,10 +461,11 @@ static int dw_mipi_dsi_phy_init(struct dw_mipi_dsi *dsi)
static int dw_mipi_dsi_get_lane_bps(struct dw_mipi_dsi *dsi)
{
- unsigned int bpp, i, pre;
+ unsigned int i, pre;
unsigned long mpclk, pllref, tmp;
unsigned int m = 1, n = 1, target_mbps = 1000;
unsigned int max_mbps = dptdin_map[ARRAY_SIZE(dptdin_map) - 1].max_mbps;
+ int bpp;
bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
if (bpp < 0) {