All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: trix@redhat.com
Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com,
	robert.foss@linaro.org,  laurent.pinchart@ideasonboard.com,
	jonas@kwiboo.se, jernej.skrabec@gmail.com,  airlied@linux.ie,
	daniel@ffwll.ch, nathan@kernel.org, xji@analogixsemi.com,
	 sam@ravnborg.org, tzungbi@google.com, pihsun@chromium.org,
	maxime@cerno.tech,  dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,  llvm@lists.linux.dev,
	hsinyi@chromium.org
Subject: Re: [PATCH] drm/bridge: anx7625: check the return on anx7625_aux_trans
Date: Tue, 8 Mar 2022 14:57:07 -0800	[thread overview]
Message-ID: <CAKwvOdnoV_SsFuWWJd4nOOd1vGG6_-gg-KvdOg4_NHuRp7_WfA@mail.gmail.com> (raw)
In-Reply-To: <20220303201943.501746-1-trix@redhat.com>

On Thu, Mar 3, 2022 at 12:19 PM <trix@redhat.com> wrote:
>
> From: Tom Rix <trix@redhat.com>
>
> Clang static analysis reports this issue
> anx7625.c:876:13: warning: The left operand of '&' is
>   a garbage value
>   if (!(bcap & 0xOA01)) {
>         ~~~~ ^
>
> bcap is only set by a successful call to
> anx7625_aux_trans().  So check.
>
> Fixes: cd1637c7e480 ("drm/bridge: anx7625: add HDCP support")

Is this the correct Fixes tag?

I think it should be

Fixes: adca62ec370c ("drm/bridge: anx7625: Support reading edid
through aux channel")

instead.

> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 633618bafd75d..f02ac079ed2ec 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -872,7 +872,10 @@ static int anx7625_hdcp_enable(struct anx7625_data *ctx)
>         }
>
>         /* Read downstream capability */
> -       anx7625_aux_trans(ctx, DP_AUX_NATIVE_READ, 0x68028, 1, &bcap);
> +       ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_READ, 0x68028, 1, &bcap);
> +       if (ret < 0)
> +               return ret;
> +
>         if (!(bcap & 0x01)) {
>                 pr_warn("downstream not support HDCP 1.4, cap(%x).\n", bcap);
>                 return 0;
> --
> 2.26.3
>


-- 
Thanks,
~Nick Desaulniers

WARNING: multiple messages have this Message-ID (diff)
From: Nick Desaulniers <ndesaulniers@google.com>
To: trix@redhat.com
Cc: llvm@lists.linux.dev, jonas@kwiboo.se, airlied@linux.ie,
	robert.foss@linaro.org, dri-devel@lists.freedesktop.org,
	narmstrong@baylibre.com, linux-kernel@vger.kernel.org,
	jernej.skrabec@gmail.com, nathan@kernel.org, tzungbi@google.com,
	pihsun@chromium.org, laurent.pinchart@ideasonboard.com,
	andrzej.hajda@intel.com, hsinyi@chromium.org, sam@ravnborg.org,
	xji@analogixsemi.com, maxime@cerno.tech
Subject: Re: [PATCH] drm/bridge: anx7625: check the return on anx7625_aux_trans
Date: Tue, 8 Mar 2022 14:57:07 -0800	[thread overview]
Message-ID: <CAKwvOdnoV_SsFuWWJd4nOOd1vGG6_-gg-KvdOg4_NHuRp7_WfA@mail.gmail.com> (raw)
In-Reply-To: <20220303201943.501746-1-trix@redhat.com>

On Thu, Mar 3, 2022 at 12:19 PM <trix@redhat.com> wrote:
>
> From: Tom Rix <trix@redhat.com>
>
> Clang static analysis reports this issue
> anx7625.c:876:13: warning: The left operand of '&' is
>   a garbage value
>   if (!(bcap & 0xOA01)) {
>         ~~~~ ^
>
> bcap is only set by a successful call to
> anx7625_aux_trans().  So check.
>
> Fixes: cd1637c7e480 ("drm/bridge: anx7625: add HDCP support")

Is this the correct Fixes tag?

I think it should be

Fixes: adca62ec370c ("drm/bridge: anx7625: Support reading edid
through aux channel")

instead.

> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 633618bafd75d..f02ac079ed2ec 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -872,7 +872,10 @@ static int anx7625_hdcp_enable(struct anx7625_data *ctx)
>         }
>
>         /* Read downstream capability */
> -       anx7625_aux_trans(ctx, DP_AUX_NATIVE_READ, 0x68028, 1, &bcap);
> +       ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_READ, 0x68028, 1, &bcap);
> +       if (ret < 0)
> +               return ret;
> +
>         if (!(bcap & 0x01)) {
>                 pr_warn("downstream not support HDCP 1.4, cap(%x).\n", bcap);
>                 return 0;
> --
> 2.26.3
>


-- 
Thanks,
~Nick Desaulniers

  reply	other threads:[~2022-03-08 22:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 20:19 [PATCH] drm/bridge: anx7625: check the return on anx7625_aux_trans trix
2022-03-03 20:19 ` trix
2022-03-08 22:57 ` Nick Desaulniers [this message]
2022-03-08 22:57   ` Nick Desaulniers
2022-03-09  1:45   ` Tom Rix
2022-03-09  1:45     ` Tom Rix
2022-03-09 13:48     ` Robert Foss
2022-03-09 13:48       ` Robert Foss

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=CAKwvOdnoV_SsFuWWJd4nOOd1vGG6_-gg-KvdOg4_NHuRp7_WfA@mail.gmail.com \
    --to=ndesaulniers@google.com \
    --cc=airlied@linux.ie \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hsinyi@chromium.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=maxime@cerno.tech \
    --cc=narmstrong@baylibre.com \
    --cc=nathan@kernel.org \
    --cc=pihsun@chromium.org \
    --cc=robert.foss@linaro.org \
    --cc=sam@ravnborg.org \
    --cc=trix@redhat.com \
    --cc=tzungbi@google.com \
    --cc=xji@analogixsemi.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.