@@ -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);
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(-)