From: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
To: "Gary Guo" <gary@garyguo.net>, "Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Wedson Almeida Filho" <wedsonaf@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@samsung.com>,
"Alice Ryhl" <aliceryhl@google.com>,
"Vincenzo Palazzo" <vincenzopalazzodev@gmail.com>,
"Vlastimil Babka" <vbabka@suse.cz>
Cc: Wedson Almeida Filho <walmeida@microsoft.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust: bindings: rename const binding using sed
Date: Sat, 30 Sep 2023 19:41:10 -0300 [thread overview]
Message-ID: <692c07f3-34c6-4bbb-b421-b71919573f90@gmail.com> (raw)
In-Reply-To: <20230930133704.13313-1-gary@garyguo.net>
On 9/30/23 10:36, Gary Guo wrote:
> Current for consts that bindgen don't recognise, we define a helper
> constant with
>
> const <TYPE> BINDINGS_<NAME> = <NAME>;
>
> in `bindings_helper.h` and then we put
>
> pub const <NAME>: <TYPE> = BINDINGS_<NAME>;
>
> in `bindings/lib.rs`. This is fine that we currently only have 3
> constants that are defined this way, but is going to be more annoying
> when more constants are added since every new constant needs to be
> defined in two places.
>
> This patch changes the way we define constant helpers to
>
> const <TYPE> RUST_BINDING_<NAME> = <NAME>;
>
> and then use `sed` to postprocess Rust code by generated by bindgen to
> remove the distinct prefix, so user of the binding crate can refer to
> the name directly.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>
> ---
> [...]
This one is a must have.
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
next prev parent reply other threads:[~2023-09-30 23:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-30 13:36 Gary Guo
2023-09-30 22:41 ` Martin Rodriguez Reboredo [this message]
2023-10-01 12:12 ` Alice Ryhl
2023-10-17 7:15 ` Benno Lossin
2023-10-20 10:51 ` Andreas Hindborg (Samsung)
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=692c07f3-34c6-4bbb-b421-b71919573f90@gmail.com \
--to=yakoyoku@gmail.com \
--cc=a.hindborg@samsung.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=vbabka@suse.cz \
--cc=vincenzopalazzodev@gmail.com \
--cc=walmeida@microsoft.com \
--cc=wedsonaf@gmail.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
all inboxes | Powered by JetHome®