[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250718204653.1289b26f@canb.auug.org.au>
Date: Fri, 18 Jul 2025 20:46:53 +1000
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Miguel Ojeda <ojeda@...nel.org>, Greg KH <greg@...ah.com>, Danilo
Krummrich <dakr@...nel.org>, "Rafael J. Wysocki" <rafael@...nel.org>
Cc: FUJITA Tomonori <fujita.tomonori@...il.com>, Linux Kernel Mailing List
<linux-kernel@...r.kernel.org>, Linux Next Mailing List
<linux-next@...r.kernel.org>, Tamir Duberstein <tamird@...il.com>
Subject: linux-next: manual merge of the rust tree with the driver-core tree
Hi all,
Today's linux-next merge of the rust tree got a conflict in:
rust/kernel/device_id.rs
between commit:
8d84b32075fb ("rust: device_id: split out index support into a separate trait")
from the driver-core tree and commit:
5e30550558b1 ("rust: enable `clippy::as_underscore` lint")
from the rust tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc rust/kernel/device_id.rs
index 8ed2c946144c,3dc72ca8cfc2..000000000000
--- a/rust/kernel/device_id.rs
+++ b/rust/kernel/device_id.rs
@@@ -94,16 -77,14 +94,16 @@@ impl<T: RawDeviceId, U, const N: usize
// SAFETY: by the safety requirement of `RawDeviceId`, we're guaranteed that `T` is
// layout-wise compatible with `RawType`.
raw_ids[i] = unsafe { core::mem::transmute_copy(&ids[i].0) };
- // SAFETY: by the safety requirement of `RawDeviceId`, this would be effectively
- // `raw_ids[i].driver_data = i;`.
- unsafe {
- raw_ids[i]
- .as_mut_ptr()
- .byte_add(T::DRIVER_DATA_OFFSET)
- .cast::<usize>()
- .write(i);
+ if let Some(data_offset) = data_offset {
+ // SAFETY: by the safety requirement of this function, this would be effectively
+ // `raw_ids[i].driver_data = i;`.
+ unsafe {
+ raw_ids[i]
+ .as_mut_ptr()
- .byte_offset(data_offset as _)
++ .byte_add(data_offset)
+ .cast::<usize>()
+ .write(i);
+ }
}
// SAFETY: this is effectively a move: `infos[i] = ids[i].1`. We make a copy here but
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists