Hi Antonio,
kernel test robot noticed the following build warnings:
[auto build test WARNING on rust/rust-next] [also build test WARNING on driver-core/driver-core-testing driver-core/driver-core-next driver-core/driver-core-linus linus/master v6.14-rc6 next-20250313] [cannot apply to shuah-kselftest/kunit shuah-kselftest/kunit-fixes pci/next pci/for-linus rust/rust-block-next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Antonio-Hickey/rust-clippy-di... base: https://github.com/Rust-for-Linux/linux rust-next patch link: https://lore.kernel.org/r/010001958dfec447-37d6d276-32f8-4b4e-b7bd-6d7ce2570... patch subject: [PATCH 3/3] rust: replace `addr_of[_mut]!` with `&raw [mut]` config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250314/202503141434.n6oUhRIM-lkp@i...) compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff) rustc: rustc 1.78.0 (9b00956e5 2024-04-29) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250314/202503141434.n6oUhRIM-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202503141434.n6oUhRIM-lkp@intel.com/
All warnings (new ones prefixed by >>):
warning: consider removing unnecessary double parentheses
--> rust/kernel/faux.rs:48:41 | 48 | unsafe { device::Device::as_ref((&raw mut (*self.as_raw()).dev)) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_parens = note: `-W clippy::double-parens` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::double_parens)]` --
warning: unnecessary parentheses around function argument
--> rust/kernel/faux.rs:48:41 | 48 | unsafe { device::Device::as_ref((&raw mut (*self.as_raw()).dev)) } | ^ ^ | = note: `#[warn(unused_parens)]` on by default help: remove these parentheses | 48 - unsafe { device::Device::as_ref((&raw mut (*self.as_raw()).dev)) } 48 + unsafe { device::Device::as_ref(&raw mut (*self.as_raw()).dev) } | --
warning: immediately dereferencing a reference
--> rust/kernel/task.rs:260:28 | 260 | let ptr = unsafe { *(&raw const (*self.as_ptr()).group_leader) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*self.as_ptr()).group_leader` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof = note: `-W clippy::deref-addrof` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::deref_addrof)]` --
warning: immediately dereferencing a reference
--> rust/kernel/task.rs:272:18 | 272 | unsafe { *(&raw const (*self.as_ptr()).pid) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*self.as_ptr()).pid` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof