]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
binder: use enum for binder ioctls
authorAlice Ryhl <aliceryhl@google.com>
Fri, 8 Dec 2023 15:28:01 +0000 (15:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Dec 2023 16:06:45 +0000 (17:06 +0100)
commit3634783be125381c6d390938d08cbcc47fed3b73
tree570978b5dc3a4d5730e75e30e026c6039beb0cc4
parentd667378ade2367fc0423ebcfd79d3a0e813ebd5c
binder: use enum for binder ioctls

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@google.com/
Link: https://lore.kernel.org/all/YoIK2l6xbQMPGZHy@kroah.com/
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20231208152801.3425772-1-aliceryhl@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/uapi/linux/android/binder.h