Re: [PATCH v1] binder: convert `BINDER_*` ioctl `#define`s into an `enum`

From: Greg Kroah-Hartman
Date: Mon May 16 2022 - 12:58:33 EST


On Mon, May 16, 2022 at 12:04:01PM +0200, Miguel Ojeda wrote:
> bindgen (a tool which generates the "raw" C bindings for Rust) only
> works (so far) with "simple" C `#define`s. In order to avoid having
> to manually maintain these constants in the (potential) Rust side,
> this patch converts them into an `enum`.
>
> 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.
>
> Co-developed-by: Wedson Almeida Filho <wedsonaf@xxxxxxxxxx>
> Signed-off-by: Wedson Almeida Filho <wedsonaf@xxxxxxxxxx>
> Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
> ---
> Two notes:
> - Let me know if you prefer that I base this on top of a binder branch.

Yes, this does not apply to my char-misc.git tree in the char-misc-next
branch on git.kernel.org as I think we have added some new binder ioctls
recently.

Or you can make it against linux-next with the rust stuff removed, that
also would work as well. But as-is, this patch does not work.

thanks,

greg k-h