public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Ethan Tidmore <ethantidmore06@gmail.com>, Jagan Teki <jagan@edgeble.ai>
Cc: Jessica Zhang <jesszhan0024@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Linus Walleij <linusw@kernel.org>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/panel: jadard-jd9365da-h3: Fix signedness bug
Date: Thu, 30 Apr 2026 11:46:05 +0200	[thread overview]
Message-ID: <f3beffd5-ff8b-414a-bddf-fb2d85bbe444@linaro.org> (raw)
In-Reply-To: <20260429024954.697411-1-ethantidmore06@gmail.com>

On 4/29/26 04:49, Ethan Tidmore wrote:
> The function drm_of_get_data_lanes_count_remote() returns negative error
> codes and dsi->lanes is an unsigned integer, so the check (dsi->lanes <
> 0) is always impossible.
> 
> Detected by Smatch:
> drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c:2959 jadard_dsi_probe()
> warn: unsigned 'dsi->lanes' is never less than zero.
> 
> Fixes: eb019688f2a97 ("drm/panel: jadard-jd9365da-h3: support variable DSI configuration")
> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
> ---
>   drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
> index 7157b1299bfd..f6b04de1182e 100644
> --- a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
> +++ b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
> @@ -2955,9 +2955,11 @@ static int jadard_dsi_probe(struct mipi_dsi_device *dsi)
>   	dsi->format = desc->format;
>   	dsi->lanes = desc->lanes;
>   	if (!dsi->lanes) {
> -		dsi->lanes = drm_of_get_data_lanes_count_remote(dsi->dev.of_node, 0, -1, 2, 4);
> -		if (dsi->lanes < 0)
> -			return dsi->lanes;
> +		ret = drm_of_get_data_lanes_count_remote(dsi->dev.of_node, 0, -1, 2, 4);
> +		if (ret < 0)
> +			return ret;
> +		dsi->lanes = ret;
> +
>   		if (dsi->lanes == 4) {
>   			if (!desc->mode_4ln) {
>   				dev_err(&dsi->dev, "4-lane config is not supported\n");

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

  reply	other threads:[~2026-04-30  9:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  2:49 [PATCH] drm/panel: jadard-jd9365da-h3: Fix signedness bug Ethan Tidmore
2026-04-30  9:46 ` Neil Armstrong [this message]
2026-05-05 13:39 ` Neil Armstrong

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=f3beffd5-ff8b-414a-bddf-fb2d85bbe444@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=airlied@gmail.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ethantidmore06@gmail.com \
    --cc=jagan@edgeble.ai \
    --cc=jesszhan0024@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox