[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025010944-detective-borough-b158@gregkh>
Date: Thu, 9 Jan 2025 08:35:04 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: "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>,
Alice Ryhl <aliceryhl@...gle.com>, 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 02/15] cpufreq: Add cpufreq_table_len()
On Thu, Jan 09, 2025 at 10:11:17AM +0530, Viresh Kumar wrote:
> On 08-01-25, 12:50, Greg KH wrote:
> > Odd, why can't Rust also know where CPUFREQ_TABLE_END is? Why do you
> > have to do extra work here? That feels wrong.
>
> Well, it can, sure.
>
> The freq table the Rust code receives is part of the C code:
> bindings::cpufreq_frequency_table. Since it is a C managed pointer, I thought it
> is better to do the parsing in C code itself. In case the implementation of the
> struct changes in future (unlikely though), we would only need to fix the C code
> and not Rust, which looks to be the right expectation.
Then why not make the C code use this function as well, to keep all
cpufreq drivers from having to manually walk the list and that way both
C and Rust drivers all do the same thing? That makes more sense to me,
there's no reason you can't change C code today first to make things
more unified, in fact, that's usually a better idea overall anyway.
thanks,
greg k-h
Powered by blists - more mailing lists