intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Anshuman Gupta <anshuman.gupta@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 2/2] drm/i915/hdcp: Fix uninitialized symbol
Date: Wed, 20 Jan 2021 15:01:34 +0530	[thread overview]
Message-ID: <e4fbdf83-1359-d5d1-95ee-c7ee044d9a3b@intel.com> (raw)
In-Reply-To: <20210119064655.1605-3-anshuman.gupta@intel.com>


On 1/19/2021 12:16 PM, Anshuman Gupta wrote:
> Move (num_hdcp_streams > 0) condition to stream_encryption()
> code block, where it actually belongs.
> This fixes the static analysis error of uninitialized symbol 'ret'.
>
> Cc: Ramalingam C <ramalingam.c@intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_hdcp.c | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index 581ccb038b87..9ca0d67b10f5 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -878,15 +878,15 @@ static int _intel_hdcp_disable(struct intel_connector *connector)
>   		}
>   		drm_dbg_kms(&dev_priv->drm, "HDCP 1.4 transcoder: %s stream encryption disabled\n",
>   			    transcoder_name(hdcp->stream_transcoder));
> +		/*
> +		 * If there are other connectors on this port using HDCP,
> +		 * don't disable it until it disabled HDCP encryption for
> +		 * all connectors in MST topology.
> +		 */
> +		if (dig_port->num_hdcp_streams > 0)
> +			return ret;

Looks good to me. Agreed Check for num_hdcp_streams should be inside the 
block for checking stream_encryption.

Small suggestion: return 0 would be more appropriate here as the return 
value is already checked for error in previous lines.

We just want to return successfully from here, as there is nothing to do 
in case there are still active hdcp_streams.

Same for the hdcp_2_disable below.

In any case:

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

>   	}
>   
> -	/*
> -	 * If there are other connectors on this port using HDCP, don't disable it
> -	 * until it disabled HDCP encryption for all connectors in MST topology.
> -	 */
> -	if (dig_port->num_hdcp_streams > 0)
> -		return ret;
> -
>   	hdcp->hdcp_encrypted = false;
>   	intel_de_write(dev_priv, HDCP_CONF(dev_priv, cpu_transcoder, port), 0);
>   	if (intel_de_wait_for_clear(dev_priv,
> @@ -1947,10 +1947,10 @@ static int _intel_hdcp2_disable(struct intel_connector *connector)
>   		}
>   		drm_dbg_kms(&i915->drm, "HDCP 2.2 transcoder: %s stream encryption disabled\n",
>   			    transcoder_name(hdcp->stream_transcoder));
> -	}
>   
> -	if (dig_port->num_hdcp_streams > 0)
> -		return ret;
> +		if (dig_port->num_hdcp_streams > 0)
> +			return ret;
> +	}
>   
>   	ret = hdcp2_disable_encryption(connector);
>   
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-01-20  9:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19  6:46 [Intel-gfx] [PATCH v2 0/2] HDCP misc fixes Anshuman Gupta
2021-01-19  6:46 ` [Intel-gfx] [PATCH v2 1/2] drm/i915/hdcp: Fix WARN_ON(data->k > INTEL_NUM_PIPES) Anshuman Gupta
2021-01-22  8:48   ` Nautiyal, Ankit K
2021-01-19  6:46 ` [Intel-gfx] [PATCH v2 2/2] drm/i915/hdcp: Fix uninitialized symbol Anshuman Gupta
2021-01-20  9:31   ` Nautiyal, Ankit K [this message]
2021-01-20 10:30   ` Anshuman Gupta
2021-01-19  8:09 ` [Intel-gfx] ✓ Fi.CI.BAT: success for HDCP misc fixes Patchwork
2021-01-19  9:31 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-01-20 16:25 ` [Intel-gfx] ✓ Fi.CI.BAT: success for HDCP misc fixes (rev2) Patchwork
     [not found] ` <161116841080.8788.5294966811685878528@emeril.freedesktop.org>
2021-01-22 11:04   ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Anshuman Gupta

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=e4fbdf83-1359-d5d1-95ee-c7ee044d9a3b@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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;
as well as URLs for NNTP newsgroup(s).