Subject: linux-next: build failure after merge of the cpufreq-arm tree

From: Stephen Rothwell <[email-masked]>
Date: Mon, 28 Apr 2025 11:57:04 +1000

Hi all,

After merging the cpufreq-arm tree, today's linux-next build (x86_64
allmodconfig) failed like this:

error[E0308]: mismatched types
   --> rust/kernel/cpufreq.rs:950:18
    |
950 |             Some(Self::update_limits_callback)
    |             ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item
    |             |
    |             arguments to this enum variant are incorrect
    |
    = note: expected fn pointer `unsafe extern "C" fn(*mut bindings::cpufreq_policy)`
                  found fn item `extern "C" fn(u32) {cpufreq::Registration::<T>::update_limits_callback}`
help: the type constructed contains `extern "C" fn(u32) {cpufreq::Registration::<T>::update_limits_callback}` due to the type of the argument passed
   --> rust/kernel/cpufreq.rs:950:13
    |
950 |             Some(Self::update_limits_callback)
    |             ^^^^^----------------------------^
    |                  |
    |                  this argument influences the type of `Some`
note: tuple variant defined here
   --> /usr/lib/rustlib/src/rust/library/core/src/option.rs:580:5
    |
580 |     Some(#[stable(feature = "rust1", since = "1.0.0")] T),
    |     ^^^^

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.

Caused by commit

  c490d1f07bec ("rust: cpufreq: Extend abstractions for driver registration")

I have used the cpufreq-arm tree from next-20250424 for today.

-- 
Cheers,
Stephen Rothwell