The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] drm/tyr: remove imports available from prelude
@ 2026-06-10 14:13 Gary Guo
  2026-06-10 16:45 ` Deborah Brouwer
  2026-06-10 17:43 ` Onur Özkan
  0 siblings, 2 replies; 4+ messages in thread
From: Gary Guo @ 2026-06-10 14:13 UTC (permalink / raw)
  To: Daniel Almeida, Alice Ryhl, Danilo Krummrich, David Airlie,
	Simona Vetter, Benno Lossin, Gary Guo
  Cc: dri-devel, linux-kernel, rust-for-linux

From: Gary Guo <gary@garyguo.net>

No functional changes intended.

Signed-off-by: Gary Guo <gary@garyguo.net>
---
 drivers/gpu/drm/tyr/regs.rs | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/tyr/regs.rs b/drivers/gpu/drm/tyr/regs.rs
index 562023e5df2f..831357a8ef87 100644
--- a/drivers/gpu/drm/tyr/regs.rs
+++ b/drivers/gpu/drm/tyr/regs.rs
@@ -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
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/tyr: remove imports available from prelude
  2026-06-10 14:13 [PATCH] drm/tyr: remove imports available from prelude Gary Guo
@ 2026-06-10 16:45 ` Deborah Brouwer
  2026-06-10 17:43 ` Onur Özkan
  1 sibling, 0 replies; 4+ messages in thread
From: Deborah Brouwer @ 2026-06-10 16:45 UTC (permalink / raw)
  To: Gary Guo
  Cc: Daniel Almeida, Alice Ryhl, Danilo Krummrich, David Airlie,
	Simona Vetter, Benno Lossin, dri-devel, linux-kernel,
	rust-for-linux

On Wed, Jun 10, 2026 at 03:13:58PM +0100, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
> 
> No functional changes intended.
> 
> Signed-off-by: Gary Guo <gary@garyguo.net>
> ---
>  drivers/gpu/drm/tyr/regs.rs | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tyr/regs.rs b/drivers/gpu/drm/tyr/regs.rs
> index 562023e5df2f..831357a8ef87 100644
> --- a/drivers/gpu/drm/tyr/regs.rs
> +++ b/drivers/gpu/drm/tyr/regs.rs
> @@ -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
> -- 
> 2.54.0
> 

Acked-by: Deborah Brouwer <deborah.brouwer@collabora.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/tyr: remove imports available from prelude
  2026-06-10 14:13 [PATCH] drm/tyr: remove imports available from prelude Gary Guo
  2026-06-10 16:45 ` Deborah Brouwer
@ 2026-06-10 17:43 ` Onur Özkan
  2026-06-10 17:45   ` Gary Guo
  1 sibling, 1 reply; 4+ messages in thread
From: Onur Özkan @ 2026-06-10 17:43 UTC (permalink / raw)
  To: Gary Guo
  Cc: Daniel Almeida, Alice Ryhl, Danilo Krummrich, David Airlie,
	Simona Vetter, Benno Lossin, Gary Guo, dri-devel, linux-kernel,
	rust-for-linux

On Wed, 10 Jun 2026 15:13:58 +0100
Gary Guo <gary@kernel.org> wrote:

> From: Gary Guo <gary@garyguo.net>
> 
> No functional changes intended.
> 
> Signed-off-by: Gary Guo <gary@garyguo.net>
> ---
>  drivers/gpu/drm/tyr/regs.rs | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tyr/regs.rs b/drivers/gpu/drm/tyr/regs.rs
> index 562023e5df2f..831357a8ef87 100644
> --- a/drivers/gpu/drm/tyr/regs.rs
> +++ b/drivers/gpu/drm/tyr/regs.rs
> @@ -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
> -- 
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/tyr: remove imports available from prelude
  2026-06-10 17:43 ` Onur Özkan
@ 2026-06-10 17:45   ` Gary Guo
  0 siblings, 0 replies; 4+ messages in thread
From: Gary Guo @ 2026-06-10 17:45 UTC (permalink / raw)
  To: Onur Özkan, Gary Guo
  Cc: Daniel Almeida, Alice Ryhl, Danilo Krummrich, David Airlie,
	Simona Vetter, Benno Lossin, Gary Guo, dri-devel, linux-kernel,
	rust-for-linux

On Wed Jun 10, 2026 at 6:43 PM BST, Onur Özkan wrote:
> On Wed, 10 Jun 2026 15:13:58 +0100
> Gary Guo <gary@kernel.org> wrote:
>
>> From: Gary Guo <gary@garyguo.net>
>> 
>> No functional changes intended.
>> 
>> Signed-off-by: Gary Guo <gary@garyguo.net>
>> ---
>>  drivers/gpu/drm/tyr/regs.rs | 14 ++------------
>>  1 file changed, 2 insertions(+), 12 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/tyr/regs.rs b/drivers/gpu/drm/tyr/regs.rs
>> index 562023e5df2f..831357a8ef87 100644
>> --- a/drivers/gpu/drm/tyr/regs.rs
>> +++ b/drivers/gpu/drm/tyr/regs.rs
>> @@ -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
>> -- 
>> 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

This is all caught by klint.

Best,
Gary

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-10 17:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-10 14:13 [PATCH] drm/tyr: remove imports available from prelude Gary Guo
2026-06-10 16:45 ` Deborah Brouwer
2026-06-10 17:43 ` Onur Özkan
2026-06-10 17:45   ` Gary Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox