diff mbox series

acpi: pm: del init error to 0

Message ID 20250604082605.119965-1-lijun01@kylinos.cn
State New
Headers show
Series acpi: pm: del init error to 0 | expand

Commit Message

Li Jun June 4, 2025, 8:26 a.m. UTC
The init action consume additional CPU cycles. the
acpi_enable_wakeup_device_power should assign a value
to 'error' before it is read.so the var don't need init
to 0.

Signed-off-by: Li Jun <lijun01@kylinos.cn>
---
 drivers/acpi/device_pm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index dbd4446025ec..f77042c930a7 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -851,7 +851,6 @@  static int __acpi_device_wakeup_enable(struct acpi_device *adev,
 {
 	struct acpi_device_wakeup *wakeup = &adev->wakeup;
 	acpi_status status;
-	int error = 0;
 
 	mutex_lock(&acpi_wakeup_lock);
 
@@ -864,7 +863,7 @@  static int __acpi_device_wakeup_enable(struct acpi_device *adev,
 	if (wakeup->enable_count > 0)
 		acpi_disable_wakeup_device_power(adev);
 
-	error = acpi_enable_wakeup_device_power(adev, target_state);
+	int error = acpi_enable_wakeup_device_power(adev, target_state);
 	if (error) {
 		if (wakeup->enable_count > 0) {
 			acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number);