From: sashiko-bot@kernel.org
To: "Wojciech Dubowik" <wojciech.dubowik@mt.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org,
dri-devel@lists.freedesktop.org, robh@kernel.org
Subject: Re: [PATCH v5 3/3] drm/bridge: ti-sn65dsi83: Add reversed lvds lanes support
Date: Fri, 17 Jul 2026 11:56:30 +0000 [thread overview]
Message-ID: <20260717115630.C58A61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260717115002.308035-4-wojciech.dubowik@mt.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] `memcmp()` is called with `ARRAY_SIZE(data_lanes)` instead of `sizeof(data_lanes)`, causing it to compare only the first element of the `u32` array.
--
--- Patch [3]: [PATCH v5 3/3] drm/bridge: ti-sn65dsi83: Add reversed lvds lanes support ---
commit 5b0901160799f83c03f127b68580169dd845ac90
Author: Wojciech Dubowik <Wojciech.Dubowik@mt.com>
drm/bridge: ti-sn65dsi83: Add reversed lvds lanes support
This commit adds support for parsing an optional "data-lanes" device tree
property. It allows the driver to configure the ti-sn65dsi83 chip for
reversed output LVDS lane order.
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> index f8a786953526d..df44df2e872af 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)
[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?
> + ctx->lvds_reverse_lanes_conf[channel] = true;
> + else if (memcmp(data_lanes,
> + supported_data_lane_mapping[LANE_MAPPING_NORMAL],
> + ARRAY_SIZE(data_lanes)) != 0)
[Severity: Medium]
The same question applies here. Because only the first element is verified,
would an invalid device tree configuration like <4 0 0 0> erroneously match
LANE_MAPPING_REVERSE and bypass the expected validation?
> + return dev_err_probe(dev, -EINVAL, "invalid data lanes mapping\n");
> + }
> +
> ret_data = of_property_read_u32_array(endpoint, "ti,lvds-vod-swing-data-microvolt",
> lvds_vod_swing_data, ARRAY_SIZE(lvds_vod_swing_data));
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260717115002.308035-1-wojciech.dubowik@mt.com?part=3
next prev parent reply other threads:[~2026-07-17 11:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 11:49 [PATCH v5 0/3] drm/bridge: ti-sn65dsi83: Add reverse lvds lanes support Wojciech Dubowik
2026-07-17 11:49 ` [PATCH v5 1/3] drm/bridge: ti-sn65dsi83: Simplify error condition logic Wojciech Dubowik
2026-07-17 20:49 ` Luca Ceresoli
2026-07-17 11:50 ` [PATCH v5 2/3] dt-bindings: display: sn65dsi83: Add output data-lanes property Wojciech Dubowik
2026-07-17 12:00 ` sashiko-bot
2026-07-20 5:51 ` Krzysztof Kozlowski
2026-07-20 6:55 ` Wojciech Dubowik
2026-07-17 11:50 ` [PATCH v5 3/3] drm/bridge: ti-sn65dsi83: Add reversed lvds lanes support Wojciech Dubowik
2026-07-17 11:56 ` sashiko-bot [this message]
2026-07-17 20:49 ` Luca Ceresoli
2026-07-20 6:39 ` Wojciech Dubowik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260717115630.C58A61F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wojciech.dubowik@mt.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.