[bug-report] Smatch warns unsigned comparison with zero in dw_mipi_dsi_rockchip_set_lcdsel()

From: Harshit Mogalapalli
Date: Mon Oct 17 2022 - 11:09:05 EST


Hi,


Smatch warns:
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c:755 dw_mipi_dsi_rockchip_set_lcdsel() warn: unsigned 'dsi->cdata->lcdsel_grf_reg'
is never less than zero.

static void dw_mipi_dsi_rockchip_set_lcdsel(struct dw_mipi_dsi_rockchip *dsi,
int mux)
{
if (dsi->cdata->lcdsel_grf_reg < 0)
regmap_write(dsi->grf_regmap, dsi->cdata->lcdsel_grf_reg,
mux ? dsi->cdata->lcdsel_lit : dsi->cdata->lcdsel_big);
}

'dsi->cdata->lcdsel_grf_reg' is of u32 type, it can never be less than zero.
So the above if condition is an impossible one.

Note: 'lcdsel_grf_reg' is set to -1 at other places.


Thanks,
Harshit