Skip to contentSkip to conversation

drm: use get_random_u64() where appropriate

PATCH New David Carlier 2 participants 3 messages Apr 5

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 drm: use get_random_u64() where appropriate

Use the typed random integer helpers instead of get_random_bytes() when filling a single integer variable. The helpers return the value directly, require no pointer or size argument, and better express intent.

---
 drivers/gpu/drm/i915/i915_hdcp_gsc.c | 2 +-
 drivers/gpu/drm/xe/xe_gsc_submit.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_hdcp_gsc.c +1 -1
index 168b9ccbef3e..a0510f5ab25c 100644
@@ -196,7 +196,7 @@ static ssize_t intel_hdcp_gsc_msg_send(struct intel_hdcp_gsc_context *gsc_contex
 
 	memset(header_in, 0, msg_size_in);
 	memset(header_out, 0, msg_size_out);
-	get_random_bytes(&host_session_id, sizeof(u64));
+	host_session_id = get_random_u64();
 	intel_gsc_uc_heci_cmd_emit_mtl_header(header_in, HECI_MEADDRESS_HDCP,
 					      msg_size_in, host_session_id);
 	memcpy(gsc_context->hdcp_cmd_in + sizeof(*header_in), msg_in, msg_in_len);
drivers/gpu/drm/xe/xe_gsc_submit.c +1 -1
index 08082b596501..195f99e6c3a8 100644
@@ -49,7 +49,7 @@ u64 xe_gsc_create_host_session_id(void)
 {
 	u64 host_session_id;
 
-	get_random_bytes(&host_session_id, sizeof(u64));
+	host_session_id = get_random_u64();
 	host_session_id &= ~HOST_SESSION_CLIENT_MASK;
 	return host_session_id;
 }
Signature · 1 line
2.53.0
#1 lore raw

✗ LGCI.VerificationFailed: failure for drm: use get_random_u64() where appropriate

== Series Details ==

== Series Details ==

Series: drm: use get_random_u64() where appropriate
URL : https://patchwork.freedesktop.org/series/164374/
State : failure

== Summary ==

Address '[email protected]' is not on the allowlist, which prevents CI from being triggered for this patch. If you want Intel GFX CI to accept this address, please contact the script maintainers at [email protected]. Exception occurred during validation, bailing out!

#2 lore raw

✗ LGCI.VerificationFailed: failure for drm: use get_random_u64() where appropriate

In reply to David Carlier
== Series Details ==

== Series Details ==

Series: drm: use get_random_u64() where appropriate
URL : https://patchwork.freedesktop.org/series/164373/
State : failure

== Summary ==

Address '[email protected]' is not on the allowlist, which prevents CI from being triggered for this patch. If you want Intel GFX CI to accept this address, please contact the script maintainers at [email protected]. Exception occurred during validation, bailing out!