Re: [PATCH v5 3/3] drm/bridge: ti-sn65dsi83: Add reversed lvds lanes support

From: Luca Ceresoli

Date: Fri Jul 17 2026 - 16:52:22 EST


On Fri, 17 Jul 2026 13:50:01 +0200, Wojciech Dubowik <wojciech.dubowik@xxxxxx> wrote:

Hello,

>
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> index f8a786953526..df44df2e872a 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> @@ -845,6 +863,19 @@ static int sn65dsi83_parse_lvds_endpoint(struct sn65dsi83 *ctx, int channel)
> else
> return -EINVAL;
>
> + ret_data = of_property_read_u32_array(endpoint, "data-lanes", data_lanes,
> + ARRAY_SIZE(data_lanes));
> + if (!ret_data) {
> + if (memcmp(data_lanes,
> + supported_data_lane_mapping[LANE_MAPPING_REVERSE],
> + ARRAY_SIZE(data_lanes)) == 0)

Did you have a look at this sashiko report? It seems valid:
| sashiko-bot@xxxxxxxxxx <sashiko-bot@xxxxxxxxxx>:
|
| [Severity: Medium]
| Does this code compare the entire array? memcmp() expects the length in
| bytes, but ARRAY_SIZE(data_lanes) evaluates to 4 (the number of elements).
|
| Because data_lanes is an array of u32, checking only 4 bytes means only
| the first element is compared. Should this be using sizeof(data_lanes)
| instead?
|
| via: https://patch.msgid.link/20260717115630.C58A61F000E9@xxxxxxxxxxxxxxx

> + ctx->lvds_reverse_lanes_conf[channel] = true;
> + else if (memcmp(data_lanes,
> + supported_data_lane_mapping[LANE_MAPPING_NORMAL],
> + ARRAY_SIZE(data_lanes)) != 0)

Same here.

Otherwise looks good.

Luca

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