[Intel-gfx] [PATCH 3/3] drm/i915/hdcp: Use both bits for device_count

Chris Wilson chris at chris-wilson.co.uk
Fri May 17 10:22:25 UTC 2019


Smatch spotted:
drivers/gpu/drm/i915//intel_hdcp.c:1406 hdcp2_authenticate_repeater_topology() warn: should this be a bitwise op?

and indeed looks to be suspect that we do need to use a bitwise or to
combine the two register fields into one counter.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Ramalingam C <ramalingam.c at intel.com>
---
 drivers/gpu/drm/i915/intel_hdcp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
index 53df2f2376e8..bc3a94d491c4 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -1402,8 +1402,8 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)
 		return -EINVAL;
 	}
 
-	device_cnt = HDCP_2_2_DEV_COUNT_HI(rx_info[0]) << 4 ||
-			HDCP_2_2_DEV_COUNT_LO(rx_info[1]);
+	device_cnt = (HDCP_2_2_DEV_COUNT_HI(rx_info[0]) << 4 |
+		      HDCP_2_2_DEV_COUNT_LO(rx_info[1]));
 	if (drm_hdcp_check_ksvs_revoked(dev, msgs.recvid_list.receiver_ids,
 					device_cnt)) {
 		DRM_ERROR("Revoked receiver ID(s) is in list\n");
-- 
2.20.1



More information about the Intel-gfx mailing list