* linux-next: workqueue + rust build fix
@ 2024-01-29 12:22 Miguel Ojeda
2024-01-29 12:36 ` Alice Ryhl
2024-02-01 17:24 ` Tejun Heo
0 siblings, 2 replies; 5+ messages in thread
From: Miguel Ojeda @ 2024-01-29 12:22 UTC (permalink / raw)
To: Tejun Heo, Alice Ryhl; +Cc: rust-for-linux
Hi Tejun, Alice,
Today's next-20240129 includes commit e563d0a7cdc1 ("workqueue: Break
up enum definitions and give names to the types") which 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:
pub type wq_misc_consts = core::ffi::c_uint;
pub const wq_misc_consts_WORK_CPU_UNBOUND: wq_misc_consts = 64;
Thus we need a small change in Rust's side [1] (which in turn triggers
a slight reformat of the code due to the line length change).
Tejun: please feel free to fixup-it into your existing commit (diff
likely mangled, sorry -- let me know if you prefer a formal patch
instead).
Thanks!
Cheers,
Miguel
[1]
diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs
index 498397877376..d00231e18007 100644
--- a/rust/kernel/workqueue.rs
+++ b/rust/kernel/workqueue.rs
@@ -199,7 +199,11 @@ pub fn enqueue<W, const ID: u64>(&self, w: W) ->
W::EnqueueOutput
// 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,
+ )
})
}
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: linux-next: workqueue + rust build fix
2024-01-29 12:22 linux-next: workqueue + rust build fix Miguel Ojeda
@ 2024-01-29 12:36 ` Alice Ryhl
2024-01-29 17:26 ` Miguel Ojeda
2024-02-01 17:24 ` Tejun Heo
1 sibling, 1 reply; 5+ messages in thread
From: Alice Ryhl @ 2024-01-29 12:36 UTC (permalink / raw)
To: Miguel Ojeda; +Cc: Tejun Heo, rust-for-linux
On Mon, Jan 29, 2024 at 1:22 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Hi Tejun, Alice,
>
> Today's next-20240129 includes commit e563d0a7cdc1 ("workqueue: Break
> up enum definitions and give names to the types") which 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:
>
> pub type wq_misc_consts = core::ffi::c_uint;
> pub const wq_misc_consts_WORK_CPU_UNBOUND: wq_misc_consts = 64;
>
> Thus we need a small change in Rust's side [1] (which in turn triggers
> a slight reformat of the code due to the line length change).
>
> Tejun: please feel free to fixup-it into your existing commit (diff
> likely mangled, sorry -- let me know if you prefer a formal patch
> instead).
>
> Thanks!
>
> Cheers,
> Miguel
>
> [1]
>
> diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs
> index 498397877376..d00231e18007 100644
> --- a/rust/kernel/workqueue.rs
> +++ b/rust/kernel/workqueue.rs
> @@ -199,7 +199,11 @@ pub fn enqueue<W, const ID: u64>(&self, w: W) ->
> W::EnqueueOutput
> // 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,
> + )
> })
> }
> }
Looks good to me, thanks for catching that Miguel.
Alice
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: linux-next: workqueue + rust build fix
2024-01-29 12:36 ` Alice Ryhl
@ 2024-01-29 17:26 ` Miguel Ojeda
0 siblings, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2024-01-29 17:26 UTC (permalink / raw)
To: Alice Ryhl; +Cc: Tejun Heo, rust-for-linux
On Mon, Jan 29, 2024 at 1:36 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> Looks good to me, thanks for catching that Miguel.
You're welcome! I appreciate the double-check.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: linux-next: workqueue + rust build fix
2024-01-29 12:22 linux-next: workqueue + rust build fix Miguel Ojeda
2024-01-29 12:36 ` Alice Ryhl
@ 2024-02-01 17:24 ` Tejun Heo
2024-02-01 19:10 ` Miguel Ojeda
1 sibling, 1 reply; 5+ messages in thread
From: Tejun Heo @ 2024-02-01 17:24 UTC (permalink / raw)
To: Miguel Ojeda; +Cc: Alice Ryhl, rust-for-linux
Hello,
On Mon, Jan 29, 2024 at 01:22:04PM +0100, Miguel Ojeda wrote:
> Tejun: please feel free to fixup-it into your existing commit (diff
> likely mangled, sorry -- let me know if you prefer a formal patch
> instead).
I missed your email. My apologies. Can you please send a signed-off patch so
that I can apply to wq/for-6.9?
Thank you.
--
tejun
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: linux-next: workqueue + rust build fix
2024-02-01 17:24 ` Tejun Heo
@ 2024-02-01 19:10 ` Miguel Ojeda
0 siblings, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2024-02-01 19:10 UTC (permalink / raw)
To: Tejun Heo; +Cc: Alice Ryhl, rust-for-linux
On Thu, Feb 1, 2024 at 6:24 PM Tejun Heo <tj@kernel.org> wrote:
>
> I missed your email. My apologies. Can you please send a signed-off patch so
> that I can apply to wq/for-6.9?
No worries at all -- it is at:
https://lore.kernel.org/rust-for-linux/20240201190620.18064-1-ojeda@kernel.org/
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-02-01 19:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-29 12:22 linux-next: workqueue + rust build fix Miguel Ojeda
2024-01-29 12:36 ` Alice Ryhl
2024-01-29 17:26 ` Miguel Ojeda
2024-02-01 17:24 ` Tejun Heo
2024-02-01 19:10 ` Miguel Ojeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).