Hi all, Today's linux-next merge of the char-misc tree got a conflict in: rust/kernel/miscdevice.rs between commit: a4082121eeb5c ("rust: miscdevice: use `#[optional]` attribute of `#[vtable]` macro") from the rust tree and commit: ba9d2c7ea7f8f ("rust: miscdevice: add registration data to MiscDevice") from the char-misc 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. diff --cc rust/kernel/miscdevice.rs index eacea29e3fb07,ecc142a1b7ea2..0000000000000 --- a/rust/kernel/miscdevice.rs +++ b/rust/kernel/miscdevice.rs @@@ -10,8 -10,12 +10,9 @@@ use crate::{ bindings, + container_of, device::Device, - error::{ - to_result, - VTABLE_DEFAULT_ERROR, // - }, + error::to_result, fs::{ File, Kiocb, // @@@ -142,29 -180,31 +177,29 @@@ pub trait MiscDevice: Sized + Sync /// the VMA initialization by calling methods of `vma`. If the function does not return an /// error, the kernel will complete initialization of the VMA according to the properties of /// `vma`. + #[optional] fn mmap( - _device: ::Borrowed<'_>, + _device: ::Borrowed<'_>, _file: &File, _vma: &VmaNew, - ) -> Result { - build_error!(VTABLE_DEFAULT_ERROR) - } + ) -> Result; /// Read from this miscdevice. - fn read_iter(_kiocb: Kiocb<'_, Self::File>, _iov: &mut IovIterDest<'_>) -> Result { - build_error!(VTABLE_DEFAULT_ERROR) - } + #[optional] - fn read_iter(_kiocb: Kiocb<'_, Self::Ptr>, _iov: &mut IovIterDest<'_>) -> Result; ++ fn read_iter(_kiocb: Kiocb<'_, Self::File>, _iov: &mut IovIterDest<'_>) -> Result; /// Write to this miscdevice. - fn write_iter(_kiocb: Kiocb<'_, Self::File>, _iov: &mut IovIterSource<'_>) -> Result { - build_error!(VTABLE_DEFAULT_ERROR) - } + #[optional] - fn write_iter(_kiocb: Kiocb<'_, Self::Ptr>, _iov: &mut IovIterSource<'_>) -> Result; ++ fn write_iter(_kiocb: Kiocb<'_, Self::File>, _iov: &mut IovIterSource<'_>) -> Result; /// Handler for ioctls. /// /// The `cmd` argument is usually manipulated using the utilities in [`kernel::ioctl`]. /// /// [`kernel::ioctl`]: mod@crate::ioctl + #[optional] fn ioctl( - _device: ::Borrowed<'_>, + _device: ::Borrowed<'_>, _file: &File, _cmd: u32, _arg: usize, @@@ -178,21 -220,23 +213,21 @@@ /// that have different layout on 32-bit and 64-bit userspace. If no implementation is /// provided, then `compat_ptr_ioctl` will be used instead. #[cfg(CONFIG_COMPAT)] + #[optional] fn compat_ioctl( - _device: ::Borrowed<'_>, + _device: ::Borrowed<'_>, _file: &File, _cmd: u32, _arg: usize, - ) -> Result { - build_error!(VTABLE_DEFAULT_ERROR) - } + ) -> Result; /// Show info for this fd. + #[optional] fn show_fdinfo( - _device: ::Borrowed<'_>, + _device: ::Borrowed<'_>, _m: &SeqFile, _file: &File, - ) { - build_error!(VTABLE_DEFAULT_ERROR) - } + ); } /// A vtable for the file operations of a Rust miscdevice.