Skip to contentSkip to conversation

drm: rockchip: signedness bug in dw_mipi_dsi_get_lane_bps()

PATCH In review Dan Carpenter 2 participants 2 messages Jan 20, 2016

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: rockchip: signedness bug in dw_mipi_dsi_get_lane_bps()

"bpp" needs to be signed for the error handling to work.

Fixes 84e05408fcfe ('drm: rockchip: Support Synopsys DW MIPI DSI')
drivers/gpu/drm/rockchip/dw-mipi-dsi.c +2 -1
index 7bfe243..c35e5af 100644
@@ -461,7 +461,8 @@ 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;
+	int bpp;
+	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;
maintainer
#1 lore raw

Hi Dan,

Am Mittwoch, 20. Januar 2016, 12:53:52 schrieb Dan Carpenter:

Quoted 4 lines

"bpp" needs to be signed for the error handling to work.

Fixes 84e05408fcfe ('drm: rockchip: Support Synopsys DW MIPI DSI')

There's also "drm/rockchip/dsi: fix handling mipi_dsi_pixel_format_to_bpp result" from Andrzej Hajda from january the 14th doing the same change.

Heiko

Quoted 15 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c index 7bfe243..c35e5af 100644

drivers/gpu/drm/rockchip/dw-mipi-dsi.c +2 -1
@@ -461,7 +461,8 @@ 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;
+	int bpp;
+	unsigned int i, pre;
 	unsigned long mpclk, pllref, tmp;
 	unsigned int m = 1, n = 1, target_mbps = 1000;
Quoted 1 line

unsigned int max_mbps = dptdin_map[ARRAY_SIZE(dptdin_map) -

1].max_mbps;