Re: [PATCH 3/3] rust: replace `addr_of[_mut]!` with `&raw [mut]`
From: kernel test robot <hidden>
Date: 2025-03-14 07:10:58
Also in:
linux-block, linux-kselftest, linux-pci, lkml, oe-kbuild-all, rust-for-linux
Possibly related (same subject, not in this thread)
- 2025-03-13 · Re: [PATCH 3/3] rust: replace `addr_of[_mut]!` with `&raw [mut]` · Benno Lossin <hidden>
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-disable-addr_of-and-addr_of_mut-macros/20250313-133646 base: https://github.com/Rust-for-Linux/linux rust-next patch link: https://lore.kernel.org/r/010001958dfec447-37d6d276-32f8-4b4e-b7bd-6d7ce2570ee2-000000%40email.amazonses.com 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@intel.com/config) 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@intel.com/reproduce) 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 [off-list ref] | Closes: https://lore.kernel.org/oe-kbuild-all/202503141434.n6oUhRIM-lkp@intel.com/ (local) All warnings (new ones prefixed by >>):
quoted
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)]`
--quoted
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) }
|
--quoted
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)]`
--quoted
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
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki