Skip to content

Commit

Permalink
workqueue: rust: sync with WORK_CPU_UNBOUND change
Browse files Browse the repository at this point in the history
Commit e563d0a ("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: e563d0a ("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>
Miguel Ojeda authored and Tejun Heo committed Feb 1, 2024
1 parent c5f8cd6 commit 3e0bc28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rust/kernel/workqueue.rs
Original file line number Diff line number Diff line change
@@ -199,7 +199,11 @@ impl Queue {
// stay valid until we call the function pointer in the `work_struct`, so the access is ok.
unsafe {
w.__enqueue(move |work_ptr| {
bindings::queue_work_on(bindings::WORK_CPU_UNBOUND as _, queue_ptr, work_ptr)
bindings::queue_work_on(
bindings::wq_misc_consts_WORK_CPU_UNBOUND as _,
queue_ptr,
work_ptr,
)
})
}
}

0 comments on commit 3e0bc28

Please sign in to comment.