mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
ACPI: processor: idle: Redefine two functions as void
Notice that acpi_processor_power_init() and acpi_processor_power_exit() don't need to return any values because their callers don't check them anyway, so redefine those functions as void. While at it, rearrange the code in acpi_processor_power_init() to reduce the indentation level, get rid of a redundant local variable in that function, and rephrase a code comment in it. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
This commit is contained in:
@@ -1400,47 +1400,45 @@ void acpi_processor_unregister_idle_driver(void)
|
|||||||
cpuidle_unregister_driver(&acpi_idle_driver);
|
cpuidle_unregister_driver(&acpi_idle_driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
int acpi_processor_power_init(struct acpi_processor *pr)
|
void acpi_processor_power_init(struct acpi_processor *pr)
|
||||||
{
|
{
|
||||||
int retval;
|
|
||||||
struct cpuidle_device *dev;
|
struct cpuidle_device *dev;
|
||||||
|
|
||||||
if (disabled_by_idle_boot_param())
|
if (disabled_by_idle_boot_param())
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
acpi_processor_cstate_first_run_checks();
|
acpi_processor_cstate_first_run_checks();
|
||||||
|
|
||||||
if (!acpi_processor_get_power_info(pr))
|
if (!acpi_processor_get_power_info(pr))
|
||||||
pr->flags.power_setup_done = 1;
|
pr->flags.power_setup_done = 1;
|
||||||
|
|
||||||
if (pr->flags.power) {
|
if (!pr->flags.power)
|
||||||
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
return;
|
||||||
if (!dev)
|
|
||||||
return -ENOMEM;
|
|
||||||
per_cpu(acpi_cpuidle_device, pr->id) = dev;
|
|
||||||
|
|
||||||
acpi_processor_setup_cpuidle_dev(pr, dev);
|
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
|
||||||
|
if (!dev)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Register per-cpu cpuidle_device. Cpuidle driver
|
per_cpu(acpi_cpuidle_device, pr->id) = dev;
|
||||||
* must already be registered before registering device
|
|
||||||
*/
|
|
||||||
retval = cpuidle_register_device(dev);
|
|
||||||
if (retval) {
|
|
||||||
|
|
||||||
per_cpu(acpi_cpuidle_device, pr->id) = NULL;
|
acpi_processor_setup_cpuidle_dev(pr, dev);
|
||||||
kfree(dev);
|
|
||||||
return retval;
|
/*
|
||||||
}
|
* Register a cpuidle device for this CPU. The cpuidle driver using
|
||||||
|
* this device is expected to be registered.
|
||||||
|
*/
|
||||||
|
if (cpuidle_register_device(dev)) {
|
||||||
|
per_cpu(acpi_cpuidle_device, pr->id) = NULL;
|
||||||
|
kfree(dev);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int acpi_processor_power_exit(struct acpi_processor *pr)
|
void acpi_processor_power_exit(struct acpi_processor *pr)
|
||||||
{
|
{
|
||||||
struct cpuidle_device *dev = per_cpu(acpi_cpuidle_device, pr->id);
|
struct cpuidle_device *dev = per_cpu(acpi_cpuidle_device, pr->id);
|
||||||
|
|
||||||
if (disabled_by_idle_boot_param())
|
if (disabled_by_idle_boot_param())
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
if (pr->flags.power) {
|
if (pr->flags.power) {
|
||||||
cpuidle_unregister_device(dev);
|
cpuidle_unregister_device(dev);
|
||||||
@@ -1448,7 +1446,6 @@ int acpi_processor_power_exit(struct acpi_processor *pr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pr->flags.power_setup_done = 0;
|
pr->flags.power_setup_done = 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MODULE_IMPORT_NS("ACPI_PROCESSOR_IDLE");
|
MODULE_IMPORT_NS("ACPI_PROCESSOR_IDLE");
|
||||||
|
|||||||
@@ -419,8 +419,8 @@ static inline void acpi_processor_throttling_init(void) {}
|
|||||||
/* in processor_idle.c */
|
/* in processor_idle.c */
|
||||||
extern struct cpuidle_driver acpi_idle_driver;
|
extern struct cpuidle_driver acpi_idle_driver;
|
||||||
#ifdef CONFIG_ACPI_PROCESSOR_IDLE
|
#ifdef CONFIG_ACPI_PROCESSOR_IDLE
|
||||||
int acpi_processor_power_init(struct acpi_processor *pr);
|
void acpi_processor_power_init(struct acpi_processor *pr);
|
||||||
int acpi_processor_power_exit(struct acpi_processor *pr);
|
void acpi_processor_power_exit(struct acpi_processor *pr);
|
||||||
int acpi_processor_power_state_has_changed(struct acpi_processor *pr);
|
int acpi_processor_power_state_has_changed(struct acpi_processor *pr);
|
||||||
int acpi_processor_hotplug(struct acpi_processor *pr);
|
int acpi_processor_hotplug(struct acpi_processor *pr);
|
||||||
void acpi_processor_register_idle_driver(void);
|
void acpi_processor_register_idle_driver(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user