Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

workqueue: rust: sync with `WORK_CPU_UNBOUND` change

Commit e563d0a7cdc1 ("workqueue: Break up enum definitions and give
names to the types") gives a name to the `enum` where `WORK_CPU_UNBOUND`
was defined, so `bindgen` changes its output from e.g.:

pub type _bindgen_ty_10 = core::ffi::c_uint;
pub const WORK_CPU_UNBOUND: _bindgen_ty_10 = 64;

to e.g.:

pub type wq_misc_consts = core::ffi::c_uint;
pub const wq_misc_consts_WORK_CPU_UNBOUND: wq_misc_consts = 64;

Thus update Rust's side to match the change (which requires a slight
reformat of the code), fixing the build error.

Closes: https://lore.kernel.org/rust-for-linux/CANiq72=9PZ89bCAVX0ZV4cqrYSLoZWyn-d_K4KpBMHjwUMdC3A@mail.gmail.com/
Fixes: e563d0a7cdc1 ("workqueue: Break up enum definitions and give names to the types")
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Miguel Ojeda and committed by
Tejun Heo
3e0bc285 c5f8cd6c

+5 -1
+5 -1
rust/kernel/workqueue.rs
··· 199 199 // stay valid until we call the function pointer in the `work_struct`, so the access is ok. 200 200 unsafe { 201 201 w.__enqueue(move |work_ptr| { 202 - bindings::queue_work_on(bindings::WORK_CPU_UNBOUND as _, queue_ptr, work_ptr) 202 + bindings::queue_work_on( 203 + bindings::wq_misc_consts_WORK_CPU_UNBOUND as _, 204 + queue_ptr, 205 + work_ptr, 206 + ) 203 207 }) 204 208 } 205 209 }