[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH5fLghLxZU5e+7DOXPKordBL_TMXW-_4Bc2E8fkdt_5LSykAQ@mail.gmail.com>
Date: Wed, 8 Jan 2025 10:01:09 +0100
From: Alice Ryhl <aliceryhl@...gle.com>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Daniel Almeida <daniel.almeida@...labora.com>, Greg KH <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>, Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Danilo Krummrich <dakr@...hat.com>, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>, linux-pm@...r.kernel.org,
Vincent Guittot <vincent.guittot@...aro.org>, Stephen Boyd <sboyd@...nel.org>,
Nishanth Menon <nm@...com>, rust-for-linux@...r.kernel.org,
Manos Pitsidianakis <manos.pitsidianakis@...aro.org>, Erik Schilling <erik.schilling@...aro.org>,
Alex Bennée <alex.bennee@...aro.org>,
Joakim Bech <joakim.bech@...aro.org>, Rob Herring <robh@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V6 03/15] cpufreq: Rust implementation doesn't parse BIT() macro
On Wed, Jan 8, 2025 at 7:53 AM Viresh Kumar <viresh.kumar@...aro.org> wrote:
>
> On 07-01-25, 10:29, Daniel Almeida wrote:
> > Viresh, FYI, there’s already a patch for this floating around [0].
> >
> > I can send a new version today. From Alice’s last comments, it only
> > needs a minor fix anyways.
>
> Thanks for the pointer Daniel. I was expecting that I would be able to use the
> definition from bindings generated with bindgen somehow.
>
> The C header contains:
>
> #define BIT(nr) (1 << (nr))
> #define CPUFREQ_NEED_UPDATE_LIMITS BIT(0)
>
> Bindgen doesn't get me a definition to CPUFREQ_NEED_UPDATE_LIMITS now. Is there
> a way to make that work with nested macros ? I wanted to avoid defining them
> again in the Rust side.
Change the #define to an enum instead. See commit 3634783be125
("binder: use enum for binder ioctls") for an example of this
strategy.
Alice
Powered by blists - more mailing lists