mirror of
https://github.com/torvalds/linux.git
synced 2024-12-18 17:12:55 +00:00
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>
This commit is contained in:
parent
c7647f8681
commit
484bb6c969
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user