linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Greg KH <greg@kroah.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Alex Gaynor <alex.gaynor@gmail.com>,
	Carlos Llamas <cmllamas@google.com>, Finn Behrens <me@kloenk.de>,
	Gary Guo <gary@garyguo.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Miguel Ojeda <ojeda@kernel.org>,
	Sven Van Asbroeck <thesven73@gmail.com>,
	Wayne Campbell <wcampbell1995@gmail.com>,
	Wedson Almeida Filho <wedsonaf@google.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: linux-next: manual merge of the rust tree with the char-misc tree
Date: Mon, 16 May 2022 10:18:45 +0200	[thread overview]
Message-ID: <CANiq72mtirFqVr9eHnh9Y=nAbBZcNxspdLoWKzvwmvjHfvBQ4w@mail.gmail.com> (raw)
In-Reply-To: <YoIB8WCdgHr6Cp+z@kroah.com>

Hi Greg,

On Mon, May 16, 2022 at 9:49 AM Greg KH <greg@kroah.com> wrote:
>
> Odd, why does the Rust binder implementation require the IOCTL
> definitions to be in an enum instead of a #define?

It is because bindgen (the tool which generates the "raw" C bindings)
only works with simple C `#define`s. Thus there are two options when
one hits something like this: either copy-paste them manually into the
Rust side (which adds maintenance), or change them into real
objects/identifiers in the C side.

There may be support in the future for expanding macros that end up in
a numeric one: https://github.com/rust-lang/rust-bindgen/issues/753.

Stephen: the resolution looks fine, thanks!

> If that's required, I can take that type of change now to prevent merge
> issues in the future.

We have two so far: this one (for the RFC Android patch) and another
small one in include/linux/spinlock.h (for the `sync` module).

So far I have put those changes in their respective patches, but if
you prefer I can send them independently too (like the prerequisite
patches).

Cheers,
Miguel

  reply	other threads:[~2022-05-16  8:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16  7:13 linux-next: manual merge of the rust tree with the char-misc tree Stephen Rothwell
2022-05-16  7:49 ` Greg KH
2022-05-16  8:18   ` Miguel Ojeda [this message]
2022-05-16  8:27     ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2021-04-16  7:58 Stephen Rothwell
2021-04-16  8:10 ` Greg KH
2021-04-16  8:26 ` Stephen Rothwell
2021-04-16 12:31 ` 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='CANiq72mtirFqVr9eHnh9Y=nAbBZcNxspdLoWKzvwmvjHfvBQ4w@mail.gmail.com' \
    --to=miguel.ojeda.sandonis@gmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=arnd@arndb.de \
    --cc=cmllamas@google.com \
    --cc=gary@garyguo.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=me@kloenk.de \
    --cc=ojeda@kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=thesven73@gmail.com \
    --cc=wcampbell1995@gmail.com \
    --cc=wedsonaf@google.com \
    /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 NNTP newsgroup(s).