On Sat Mar 7, 2026 at 4:32 AM CET, Ethan Tidmore wrote:
> The function drm_of_get_data_lanes_count_ep() returns negative error
> codes and dsi->lanes is an unsigned integer, so the check (dsi->lanes <
> 0) is always impossible.
>
> Make the return value of drm_of_get_data_lanes_count_ep() be assigned to
> ret, check for error, and then assign dsi->lanes to ret.
>
> Detected by Smatch:
> drivers/gpu/drm/bridge/waveshare-dsi.c:70 ws_bridge_attach_dsi() warn:
> unsigned 'dsi->lanes' is never less than zero.
>
> Reported-by: kernel test robot <[email protected]>
> Closes: 
> https://lore.kernel.org/oe-kbuild-all/[email protected]/
> Fixes: fca11428425e9 ("drm/bridge: waveshare-dsi: Add support for 1..4 DSI 
> data lanes")
> Signed-off-by: Ethan Tidmore <[email protected]>

Reviewed-by: Luca Ceresoli <[email protected]>

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Reply via email to