[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6b384169-9ad5-4689-8533-f6196d39cf4b@huawei.com>
Date: Fri, 5 Sep 2025 14:27:01 +0800
From: "lihuisong (C)" <lihuisong@...wei.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
CC: <lenb@...nel.org>, <linux-acpi@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linuxarm@...wei.com>,
<jonathan.cameron@...wei.com>, <zhanjie9@...ilicon.com>,
<zhenglifeng1@...wei.com>, <yubowen8@...wei.com>
Subject: Re: [PATCH] ACPI: processor: Fix function defined but not used
warning
在 2025/9/4 23:23, Rafael J. Wysocki 写道:
> On Thu, Sep 4, 2025 at 2:11 PM Huisong Li <lihuisong@...wei.com> wrote:
>> If CONFIG_ACPI_PROCESSOR=n and CONFIG_ACPI_PROCESSOR_IDLE=n, we may
>> encounter some compling warnings as the following link said.
>> So remove these empty function definition because they are just used
>> in processor_driver.c and if CONFIG_ACPI_PROCESSOR is selected and
>> CONFIG_ACPI_PROCESSOR_IDLE also be selected automatically.
>>
>> Reported-by: kernel test robot <lkp@...el.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202508300519.tZQHY6HA-lkp@intel.com/
>>
>> Signed-off-by: Huisong Li <lihuisong@...wei.com>
>> ---
>> include/acpi/processor.h | 34 +++-------------------------------
>> 1 file changed, 3 insertions(+), 31 deletions(-)
>>
>> diff --git a/include/acpi/processor.h b/include/acpi/processor.h
>> index 360b673f05e5..a4e1081fd0da 100644
>> --- a/include/acpi/processor.h
>> +++ b/include/acpi/processor.h
>> @@ -417,40 +417,17 @@ static inline void acpi_processor_throttling_init(void) {}
>> #endif /* CONFIG_ACPI_CPU_FREQ_PSS */
>>
>> /* in processor_idle.c */
>> -extern struct cpuidle_driver acpi_idle_driver;
>> #ifdef CONFIG_ACPI_PROCESSOR_IDLE
>> +extern struct cpuidle_driver acpi_idle_driver;
> Are the changes above related to the warning? If not, maybe move them
> to a separate patch?
Ok, will do it in a separate patch.
>
>> int acpi_processor_power_init(struct acpi_processor *pr);
>> int acpi_processor_power_exit(struct acpi_processor *pr);
>> int acpi_processor_power_state_has_changed(struct acpi_processor *pr);
>> int acpi_processor_hotplug(struct acpi_processor *pr);
>> void acpi_processor_register_idle_driver(void);
>> void acpi_processor_unregister_idle_driver(void);
>> -#else
>> -static inline int acpi_processor_power_init(struct acpi_processor *pr)
>> -{
>> - return -ENODEV;
>> -}
>> -
>> -static inline int acpi_processor_power_exit(struct acpi_processor *pr)
>> -{
>> - return -ENODEV;
>> -}
>> -
>> -static inline int acpi_processor_power_state_has_changed(struct acpi_processor *pr)
>> -{
>> - return -ENODEV;
>> -}
>>
>> -static inline int acpi_processor_hotplug(struct acpi_processor *pr)
>> -{
>> - return -ENODEV;
>> -}
>> -static inline void acpi_processor_register_idle_driver(void)
>> -{
>> -}
>> -static inline void acpi_processor_unregister_idle_driver(void)
>> -{
>> -}
>> +extern int acpi_processor_ffh_lpi_probe(unsigned int cpu);
>> +extern int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi);
> Please remove the "extern" from these declarations.
Ack
>
>> #endif /* CONFIG_ACPI_PROCESSOR_IDLE */
>>
>> /* in processor_thermal.c */
>> @@ -473,11 +450,6 @@ static inline void acpi_thermal_cpufreq_exit(struct cpufreq_policy *policy)
>> }
>> #endif /* CONFIG_CPU_FREQ */
>>
>> -#ifdef CONFIG_ACPI_PROCESSOR_IDLE
>> -extern int acpi_processor_ffh_lpi_probe(unsigned int cpu);
>> -extern int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi);
>> -#endif
>> -
>> void acpi_processor_init_invariance_cppc(void);
>>
>> #endif
>> --
Powered by blists - more mailing lists