[PATCH 13/13] drm/tyr: deny `clippy::as_conversions`

From: Daniel Almeida

Date: Wed Nov 25 2026 - 17:49:02 EST


An `as` cast silently drops the bits that do not fit the target type,
and nothing at the cast shows whether that can happen. As part of a
larger effort to reduce the number of `as` casts in Tyr, deny
`clippy::as_conversions` in the driver, so that Clippy rejects a new
cast unless it carries an `#[expect]`.

The casts that remain are all justified in a `// CAST:` comment and
marked that way.

Signed-off-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
---
drivers/gpu/drm/tyr/tyr.rs | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/tyr/tyr.rs b/drivers/gpu/drm/tyr/tyr.rs
index e7ec450bdc9c..ced937af4c53 100644
--- a/drivers/gpu/drm/tyr/tyr.rs
+++ b/drivers/gpu/drm/tyr/tyr.rs
@@ -5,6 +5,11 @@
//! The name "Tyr" is inspired by Norse mythology, reflecting Arm's tradition of
//! naming their GPUs after Nordic mythological figures and places.

+// `as` conversions can silently truncate, so they are denied by default in
+// this driver. A conversion that cannot be avoided is justified in a
+// `// CAST:` comment and marked with `#[expect(clippy::as_conversions)]`.
+#![deny(clippy::as_conversions)]
+
use crate::driver::TyrPlatformDriver;

mod driver;

--
2.56.0