Re: [PATCH v2 2/3] ACPI: processor: Remove unused empty function definition for processor_idle.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rafael,

Thanks for you fast reply.


在 2025/9/6 3:50, Rafael J. Wysocki 写道:
On Fri, Sep 5, 2025 at 10:19 AM Huisong Li <lihuisong@xxxxxxxxxx> wrote:
If CONFIG_ACPI_PROCESSOR=n and CONFIG_ACPI_PROCESSOR_IDLE=n, we may encounter
some warnings about function defined but not used.
All external functions of processor_idle.c are just used in processor_driver.c.
And if CONFIG_ACPI_PROCESSOR is selected and CONFIG_ACPI_PROCESSOR_IDLE also
be selected automatically. So remove these empty function definitions.

Signed-off-by: Huisong Li <lihuisong@xxxxxxxxxx>
---
  include/acpi/processor.h | 22 +---------------------
  1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index ff864c1cee3a..d6a87dc42a9a 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -417,34 +417,14 @@ 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;
The changes above don't belong to this patch IMV or at least I don't
see why they belong to it.

Yes, I just do it by the way.

Ok, I will fix it like the folloing way in a separate patch.

How do you think?

-->

diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index bc9f58a02c1d..5d824435b26b 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -166,8 +166,7 @@ static int __acpi_processor_start(struct acpi_device *device)
        if (result && !IS_ENABLED(CONFIG_ACPI_CPU_FREQ_PSS))
                dev_dbg(&device->dev, "CPPC data invalid or not present\n");

-       if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver)
-               acpi_processor_power_init(pr);
+       acpi_processor_power_init(pr);

        acpi_pss_perf_init(pr);

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 5dacf41d7cc0..967fb13f38fa 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1404,6 +1404,11 @@ int acpi_processor_power_init(struct acpi_processor *pr)
 {
        int retval;
        struct cpuidle_device *dev;
+       struct cpuidle_driver *drv;
+
+       drv = cpuidle_get_driver();
+       if (drv && drv != &acpi_idle_driver)
+               return 0;

        if (disabled_by_idle_boot_param())
                return 0;
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index ff864c1cee3a..dcc500bdd5cd 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -417,7 +417,6 @@ 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
 int acpi_processor_power_init(struct acpi_processor *pr);
 int acpi_processor_power_exit(struct acpi_processor *pr);


  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);
<...>




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux