Re: [PATCH V6 02/15] cpufreq: Add cpufreq_table_len()

From: Viresh Kumar
Date: Wed Jan 08 2025 - 23:41:32 EST


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.

--
viresh