Rust-for-linux archive mirror
 help / color / mirror / Atom feed
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Tejun Heo <tj@kernel.org>, Alice Ryhl <aliceryhl@google.com>
Cc: rust-for-linux <rust-for-linux@vger.kernel.org>
Subject: linux-next: workqueue + rust build fix
Date: Mon, 29 Jan 2024 13:22:04 +0100	[thread overview]
Message-ID: <CANiq72=9PZ89bCAVX0ZV4cqrYSLoZWyn-d_K4KpBMHjwUMdC3A@mail.gmail.com> (raw)

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,
+                )
             })
         }
     }

             reply	other threads:[~2024-01-29 12:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 12:22 Miguel Ojeda [this message]
2024-01-29 12:36 ` linux-next: workqueue + rust build fix Alice Ryhl
2024-01-29 17:26   ` Miguel Ojeda
2024-02-01 17:24 ` Tejun Heo
2024-02-01 19:10   ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANiq72=9PZ89bCAVX0ZV4cqrYSLoZWyn-d_K4KpBMHjwUMdC3A@mail.gmail.com' \
    --to=miguel.ojeda.sandonis@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).