Re: [PATCH] binder: use enum for binder ioctls

From: Carlos Llamas
Date: Fri Dec 08 2023 - 10:35:19 EST


On Fri, Dec 08, 2023 at 03:28:01PM +0000, Alice Ryhl wrote:
> All of the other constants in this file are defined using enums, so make
> the constants more consistent by defining the ioctls in an enum as well.
>
> This is necessary for Rust Binder since the _IO macros are too
> complicated for bindgen to see that they expand to integer constants.
> Replacing the #defines with an enum forces bindgen to evaluate them
> properly, which allows us to access them from Rust.
>
> I originally intended to include this change in the first patch of the
> Rust Binder patchset [1], but at plumbers Carlos Llamas told me that
> this change has been discussed previously [2] and suggested that I send
> it upstream separately.
>
> Link: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-1-08ba9197f637@xxxxxxxxxx/ [1]
> Link: https://lore.kernel.org/all/YoIK2l6xbQMPGZHy@xxxxxxxxx/ [2]
> Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> ---

Acked-by: Carlos Llamas <cmllamas@xxxxxxxxxx>

Thanks,
--
Carlos Llamas