summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/acpi_power_meter.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2021-01-26 21:23:17 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-01-27 18:43:07 +0100
commit10e927249c4f78b25c4941eda93548aeaad04a46 (patch)
treeff611ae1e1bbc07a0671e687b36086569ffa640f /drivers/hwmon/acpi_power_meter.c
parentACPI: Use DEVICE_ATTR_<RW|RO|WO> macros (diff)
downloadlinux-10e927249c4f78b25c4941eda93548aeaad04a46.tar.xz
linux-10e927249c4f78b25c4941eda93548aeaad04a46.zip
ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE
The double negative makes it hard to read "if (!ACPI_FAILURE(status))". Replace it with "if (ACPI_SUCCESS(status))". Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/hwmon/acpi_power_meter.c')
-rw-r--r--drivers/hwmon/acpi_power_meter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index 848718ab7312..7d3ddcba34ce 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -161,7 +161,7 @@ static ssize_t set_avg_interval(struct device *dev,
mutex_lock(&resource->lock);
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_PAI",
&args, &data);
- if (!ACPI_FAILURE(status))
+ if (ACPI_SUCCESS(status))
resource->avg_interval = temp;
mutex_unlock(&resource->lock);
@@ -232,7 +232,7 @@ static ssize_t set_cap(struct device *dev, struct device_attribute *devattr,
mutex_lock(&resource->lock);
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_SHL",
&args, &data);
- if (!ACPI_FAILURE(status))
+ if (ACPI_SUCCESS(status))
resource->cap = temp;
mutex_unlock(&resource->lock);