[norov:bitmap_param 20/21] error[E0308]: mismatched types

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
Hi Yury,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://github.com/norov/linux bitmap_param
head:   2ebf9d0d17a23d79cfabad902c9bf18f47c2adc9
commit: a13ae5f39450bd51f39aa7519689c3372e8225f0 [20/21] bitmap: use unsigned long for bit indices and sizes
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20260722/[email protected]/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
rustc: rustc 1.96.0 (ac68faa20 2026-05-25)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260722/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> error[E0308]: mismatched types
   --> rust/kernel/bitmap.rs:260:52
   |
   260 |         let ptr = unsafe { bindings::bitmap_zalloc(nbits_u32, flags.as_raw()) };
   |                            ----------------------- ^^^^^^^^^ expected `usize`, found `u32`
   |                            |
   |                            arguments to this function are incorrect
   |
   note: function defined here
   --> rust/bindings/bindings_generated.rs:24157:12
   |
   24157 |     pub fn bitmap_zalloc(nbits: ffi::c_ulong, flags: gfp_t) -> *mut ffi::c_ulong;
   |            ^^^^^^^^^^^^^
   help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
   |
   260 |         let ptr = unsafe { bindings::bitmap_zalloc(nbits_u32.try_into().unwrap(), flags.as_raw()) };
   |                                                             ++++++++++++++++++++

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.