Subject: Re: linux-next: build failure after merge of the rust-xarray tree

From: Andreas Hindborg <[email-masked]>
Date: Thu, 01 May 2025 11:41:30 +0200

"Viresh Kumar" <[email-masked]> writes:

> On 30-04-25, 20:23, Stephen Rothwell wrote:
>> Caused by commit
>>
>>   a68f46e83747 ("rust: types: add `ForeignOwnable::PointedTo`")
>>
>> interacting with commit
>>
>>   254df142ab42 ("rust: cpufreq: Add initial abstractions for cpufreq framework")
>>
>> from the cpufreq-arm tree.
>>
>> I don't know how to fix this up, so I have dropped the rust-xarray tree
>> for today.
>
> Probably this:
>
> diff --git a/rust/kernel/cpufreq.rs b/rust/kernel/cpufreq.rs
> index 49246e50f67e..82d20b999e6c 100644
> --- a/rust/kernel/cpufreq.rs
> +++ b/rust/kernel/cpufreq.rs
> @@ -630,7 +630,7 @@ pub fn data<T: ForeignOwnable>(&mut self) -> Option<<T>::Borrowed<'_>> {
>              None
>          } else {
>              // SAFETY: The data is earlier set from [`set_data`].
> -            Some(unsafe { T::borrow(self.as_ref().driver_data) })
> +            Some(unsafe { T::borrow(self.as_ref().driver_data.cast()) })
>          }
>      }
>
> @@ -657,7 +657,7 @@ fn clear_data<T: ForeignOwnable>(&mut self) -> Option<T> {
>              let data = Some(
>                  // SAFETY: The data is earlier set by us from [`set_data`]. It is safe to take
>                  // back the ownership of the data from the foreign interface.
> -                unsafe { <T as ForeignOwnable>::from_foreign(self.as_ref().driver_data) },
> +                unsafe { <T as ForeignOwnable>::from_foreign(self.as_ref().driver_data.cast()) },
>              );
>              self.as_mut_ref().driver_data = ptr::null_mut();
>              data
>
>
> Andreas, is your xarray-next branch immmutable ? I can rebase over the
> change then.

I might add tags. But I guess now that Stephen carries the merge
resolution, we should be fine? Not sure what the preferred approach is
for this situation.

Best regards,
Andreas Hindborg