Re: [PATCH] rust: enable `clippy::ptr_as_ptr` lint

From: kernel test robot
Date: Tue Mar 11 2025 - 15:23:07 EST


Hi Tamir,

kernel test robot noticed the following build warnings:

[auto build test WARNING on ff64846bee0e7e3e7bc9363ebad3bab42dd27e24]

url: https://github.com/intel-lab-lkp/linux/commits/Tamir-Duberstein/rust-enable-clippy-ptr_as_ptr-lint/20250308-004557
base: ff64846bee0e7e3e7bc9363ebad3bab42dd27e24
patch link: https://lore.kernel.org/r/20250307-ptr-as-ptr-v1-1-582d06514c98%40gmail.com
patch subject: [PATCH] rust: enable `clippy::ptr_as_ptr` lint
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250312/202503120332.YTCpFEvv-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250312/202503120332.YTCpFEvv-lkp@xxxxxxxxx/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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503120332.YTCpFEvv-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> warning: `as` casting between raw pointers without changing its mutability
--> rust/kernel/firmware.rs:64:35
|
64 | let ret = unsafe { func.0(pfw as _, name.as_char_ptr(), dev.as_raw()) };
| ^^^^^^^^ help: try `pointer::cast`, a safer alternative: `pfw.cast()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr
= note: requested on the command line with `-W clippy::ptr-as-ptr`

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki