Skip to contentSkip to conversation

drm/tyr: remove imports available from prelude

PATCH Applied Gary Guo 5 participants 5 messages Jun 10 – Jun 25

Subsystems (4)
lore
Share & tools
lore

Gary Guo

author
#0 lore raw

PATCH 1/1 drm/tyr: remove imports available from prelude

From: Gary Guo <[email protected]>

No functional changes intended.

---
 drivers/gpu/drm/tyr/regs.rs | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/gpu/drm/tyr/regs.rs +2 -12
index 562023e5df2f..831357a8ef87 100644
@@ -48,17 +48,12 @@ pub(crate) fn read_u64_no_tearing(lo_read: impl Fn() -> u32, hi_read: impl Fn()
 /// These registers correspond to the GPU_CONTROL register page.
 /// They are involved in GPU configuration and control.
 pub(crate) mod gpu_control {
-    use core::convert::TryFrom;
     use kernel::{
-        error::{
-            code::EINVAL,
-            Error, //
-        },
         num::Bounded,
+        prelude::*,
         register,
         uapi, //
     };
-    use pin_init::Zeroable;
 
     register! {
         /// GPU identification register.
@@ -964,14 +959,9 @@ pub(crate) mod mmu_control {
     ///
     /// This array contains 16 instances of the MMU_AS_CONTROL register page.
     pub(crate) mod mmu_as_control {
-        use core::convert::TryFrom;
-
         use kernel::{
-            error::{
-                code::EINVAL,
-                Error, //
-            },
             num::Bounded,
+            prelude::*,
             register, //
         };
 

base-commit: 7d570075805918f5ec33f03949c6a7c610397340

Signature · 1 line
2.54.0
Acked-by on v1 1/1
#1 lore raw
Quoted 49 lines · Gary Guo

From: Gary Guo <[email protected]>

No functional changes intended.

---
 drivers/gpu/drm/tyr/regs.rs | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/gpu/drm/tyr/regs.rs +2 -12
index 562023e5df2f..831357a8ef87 100644
@@ -48,17 +48,12 @@ pub(crate) fn read_u64_no_tearing(lo_read: impl Fn() -> u32, hi_read: impl Fn()
 /// These registers correspond to the GPU_CONTROL register page.
 /// They are involved in GPU configuration and control.
 pub(crate) mod gpu_control {
-    use core::convert::TryFrom;
     use kernel::{
-        error::{
-            code::EINVAL,
-            Error, //
-        },
         num::Bounded,
+        prelude::*,
         register,
         uapi, //
     };
-    use pin_init::Zeroable;
 
     register! {
         /// GPU identification register.
@@ -964,14 +959,9 @@ pub(crate) mod mmu_control {
     ///
     /// This array contains 16 instances of the MMU_AS_CONTROL register page.
     pub(crate) mod mmu_as_control {
-        use core::convert::TryFrom;
-
         use kernel::{
-            error::{
-                code::EINVAL,
-                Error, //
-            },
             num::Bounded,
+            prelude::*,
             register, //
         };
 
Quoted 4 lines

base-commit: 7d570075805918f5ec33f03949c6a7c610397340

Signature · 1 line
2.54.0
reviewer
#2 lore raw
In reply to Gary Guo
Quoted 49 lines · On Wed, 10 Jun 2026 15:13:58 +0100 Gary Guo <[email protected]> wrote:

From: Gary Guo <[email protected]>

No functional changes intended.

---
 drivers/gpu/drm/tyr/regs.rs | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/gpu/drm/tyr/regs.rs +2 -12
index 562023e5df2f..831357a8ef87 100644
@@ -48,17 +48,12 @@ pub(crate) fn read_u64_no_tearing(lo_read: impl Fn() -> u32, hi_read: impl Fn()
 /// These registers correspond to the GPU_CONTROL register page.
 /// They are involved in GPU configuration and control.
 pub(crate) mod gpu_control {
-    use core::convert::TryFrom;
     use kernel::{
-        error::{
-            code::EINVAL,
-            Error, //
-        },
         num::Bounded,
+        prelude::*,
         register,
         uapi, //
     };
-    use pin_init::Zeroable;
 
     register! {
         /// GPU identification register.
@@ -964,14 +959,9 @@ pub(crate) mod mmu_control {
     ///
     /// This array contains 16 instances of the MMU_AS_CONTROL register page.
     pub(crate) mod mmu_as_control {
-        use core::convert::TryFrom;
-
         use kernel::{
-            error::{
-                code::EINVAL,
-                Error, //
-            },
             num::Bounded,
+            prelude::*,
             register, //
         };
 
Quoted 4 lines

base-commit: 7d570075805918f5ec33f03949c6a7c610397340

Signature · 1 line
2.54.0

We will probably run into this again in the future. I wonder whether there is any way to catch this kind of issues automatically. If not, I feel like this prelude pattern is not doing a good job on helping.

Thanks,
Onur

reviewer
#3 lore raw
Quoted 61 lines · Onur Özkan
Quoted 49 lines · On Wed, 10 Jun 2026 15:13:58 +0100 Gary Guo <[email protected]> wrote:

From: Gary Guo <[email protected]>

No functional changes intended.

---
 drivers/gpu/drm/tyr/regs.rs | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/gpu/drm/tyr/regs.rs +2 -12
index 562023e5df2f..831357a8ef87 100644
@@ -48,17 +48,12 @@ pub(crate) fn read_u64_no_tearing(lo_read: impl Fn() -> u32, hi_read: impl Fn()
 /// These registers correspond to the GPU_CONTROL register page.
 /// They are involved in GPU configuration and control.
 pub(crate) mod gpu_control {
-    use core::convert::TryFrom;
     use kernel::{
-        error::{
-            code::EINVAL,
-            Error, //
-        },
         num::Bounded,
+        prelude::*,
         register,
         uapi, //
     };
-    use pin_init::Zeroable;
 
     register! {
         /// GPU identification register.
@@ -964,14 +959,9 @@ pub(crate) mod mmu_control {
     ///
     /// This array contains 16 instances of the MMU_AS_CONTROL register page.
     pub(crate) mod mmu_as_control {
-        use core::convert::TryFrom;
-
         use kernel::{
-            error::{
-                code::EINVAL,
-                Error, //
-            },
             num::Bounded,
+            prelude::*,
             register, //
         };
 
Quoted 4 lines

base-commit: 7d570075805918f5ec33f03949c6a7c610397340

Signature · 1 line
2.54.0

We will probably run into this again in the future. I wonder whether there is any way to catch this kind of issues automatically. If not, I feel like this prelude pattern is not doing a good job on helping.

Quoted 2 lines

Thanks,
Onur

This is all caught by klint.

Best,
Gary