diff options
| author | Jonathan Cavitt <jonathan.cavitt@intel.com> | 2026-01-23 17:09:15 +0000 |
|---|---|---|
| committer | Matt Roper <matthew.d.roper@intel.com> | 2026-01-28 16:01:08 -0800 |
| commit | 671e1cfe5b23384245be5ec094e92906ca585fce (patch) | |
| tree | 02bb5b571493eac087ad3c45c1b3b73a8654f554 | |
| parent | b3a2a91ae9b48c74e50833242af7d73f8a0ec3a6 (diff) | |
drm/i915/display: vcpi is always greater than zero
Static analysis issue:
intel_conn_to_vcpi currently checks and asserts vcpi >= 0, as grabbed
from payload->vcpi. But payload->vcpi is a u8, so this is always true.
Remove this unnecessary check.
While we're here, the jump statements in this function are largely
defunct now, so remove those as well.
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patch.msgid.link/20260123170914.64548-2-jonathan.cavitt@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
| -rw-r--r-- | drivers/gpu/drm/i915/display/intel_hdcp.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 8d3137067bf6..b7479ced7871 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -75,7 +75,6 @@ static int intel_conn_to_vcpi(struct intel_atomic_state *state, struct drm_dp_mst_topology_mgr *mgr; struct drm_dp_mst_atomic_payload *payload; struct drm_dp_mst_topology_state *mst_state; - int vcpi = 0; /* For HDMI this is forced to be 0x0. For DP SST also this is 0x0. */ if (!connector->mst.port) @@ -86,15 +85,9 @@ static int intel_conn_to_vcpi(struct intel_atomic_state *state, mst_state = to_drm_dp_mst_topology_state(mgr->base.state); payload = drm_atomic_get_mst_payload_state(mst_state, connector->mst.port); if (drm_WARN_ON(mgr->dev, !payload)) - goto out; + return 0; - vcpi = payload->vcpi; - if (drm_WARN_ON(mgr->dev, vcpi < 0)) { - vcpi = 0; - goto out; - } -out: - return vcpi; + return payload->vcpi; } /* |
