On 3/9/26 12:10 PM, Luca Ceresoli wrote:
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]>
Reviewed-by: Marek Vasut <[email protected]>
(it seems FDO patchwork did not pick this up)