Commit 10e92724 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Rafael J. Wysocki

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: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Acked-by: default avatarTakashi Iwai <tiwai@suse.de>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 0f39ee83
...@@ -291,7 +291,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev) ...@@ -291,7 +291,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev)
continue; continue;
status = acpi_get_handle(dhandle, "ATRM", &atrm_handle); status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
if (!ACPI_FAILURE(status)) { if (ACPI_SUCCESS(status)) {
found = true; found = true;
break; break;
} }
...@@ -304,7 +304,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev) ...@@ -304,7 +304,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev)
continue; continue;
status = acpi_get_handle(dhandle, "ATRM", &atrm_handle); status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
if (!ACPI_FAILURE(status)) { if (ACPI_SUCCESS(status)) {
found = true; found = true;
break; break;
} }
......
...@@ -205,7 +205,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev) ...@@ -205,7 +205,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev)
continue; continue;
status = acpi_get_handle(dhandle, "ATRM", &atrm_handle); status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
if (!ACPI_FAILURE(status)) { if (ACPI_SUCCESS(status)) {
found = true; found = true;
break; break;
} }
...@@ -218,7 +218,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev) ...@@ -218,7 +218,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev)
continue; continue;
status = acpi_get_handle(dhandle, "ATRM", &atrm_handle); status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
if (!ACPI_FAILURE(status)) { if (ACPI_SUCCESS(status)) {
found = true; found = true;
break; break;
} }
......
...@@ -161,7 +161,7 @@ static ssize_t set_avg_interval(struct device *dev, ...@@ -161,7 +161,7 @@ static ssize_t set_avg_interval(struct device *dev,
mutex_lock(&resource->lock); mutex_lock(&resource->lock);
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_PAI", status = acpi_evaluate_integer(resource->acpi_dev->handle, "_PAI",
&args, &data); &args, &data);
if (!ACPI_FAILURE(status)) if (ACPI_SUCCESS(status))
resource->avg_interval = temp; resource->avg_interval = temp;
mutex_unlock(&resource->lock); mutex_unlock(&resource->lock);
...@@ -232,7 +232,7 @@ static ssize_t set_cap(struct device *dev, struct device_attribute *devattr, ...@@ -232,7 +232,7 @@ static ssize_t set_cap(struct device *dev, struct device_attribute *devattr,
mutex_lock(&resource->lock); mutex_lock(&resource->lock);
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_SHL", status = acpi_evaluate_integer(resource->acpi_dev->handle, "_SHL",
&args, &data); &args, &data);
if (!ACPI_FAILURE(status)) if (ACPI_SUCCESS(status))
resource->cap = temp; resource->cap = temp;
mutex_unlock(&resource->lock); mutex_unlock(&resource->lock);
......
...@@ -861,7 +861,7 @@ static ssize_t infos_show(struct device *dev, struct device_attribute *attr, ...@@ -861,7 +861,7 @@ static ssize_t infos_show(struct device *dev, struct device_attribute *attr,
* The significance of others is yet to be found. * The significance of others is yet to be found.
*/ */
rv = acpi_evaluate_integer(asus->handle, "SFUN", NULL, &temp); rv = acpi_evaluate_integer(asus->handle, "SFUN", NULL, &temp);
if (!ACPI_FAILURE(rv)) if (ACPI_SUCCESS(rv))
len += sprintf(page + len, "SFUN value : %#x\n", len += sprintf(page + len, "SFUN value : %#x\n",
(uint) temp); (uint) temp);
/* /*
...@@ -873,7 +873,7 @@ static ssize_t infos_show(struct device *dev, struct device_attribute *attr, ...@@ -873,7 +873,7 @@ static ssize_t infos_show(struct device *dev, struct device_attribute *attr,
* takes several seconds to run on some systems. * takes several seconds to run on some systems.
*/ */
rv = acpi_evaluate_integer(asus->handle, "HWRS", NULL, &temp); rv = acpi_evaluate_integer(asus->handle, "HWRS", NULL, &temp);
if (!ACPI_FAILURE(rv)) if (ACPI_SUCCESS(rv))
len += sprintf(page + len, "HWRS value : %#x\n", len += sprintf(page + len, "HWRS value : %#x\n",
(uint) temp); (uint) temp);
/* /*
...@@ -884,7 +884,7 @@ static ssize_t infos_show(struct device *dev, struct device_attribute *attr, ...@@ -884,7 +884,7 @@ static ssize_t infos_show(struct device *dev, struct device_attribute *attr,
* silently ignored. * silently ignored.
*/ */
rv = acpi_evaluate_integer(asus->handle, "ASYM", NULL, &temp); rv = acpi_evaluate_integer(asus->handle, "ASYM", NULL, &temp);
if (!ACPI_FAILURE(rv)) if (ACPI_SUCCESS(rv))
len += sprintf(page + len, "ASYM value : %#x\n", len += sprintf(page + len, "ASYM value : %#x\n",
(uint) temp); (uint) temp);
if (asus->dsdt_info) { if (asus->dsdt_info) {
......
...@@ -2210,7 +2210,7 @@ static acpi_status acpi_register_spi_device(struct spi_controller *ctlr, ...@@ -2210,7 +2210,7 @@ static acpi_status acpi_register_spi_device(struct spi_controller *ctlr,
return AE_OK; return AE_OK;
if (!lookup.max_speed_hz && if (!lookup.max_speed_hz &&
!ACPI_FAILURE(acpi_get_parent(adev->handle, &parent_handle)) && ACPI_SUCCESS(acpi_get_parent(adev->handle, &parent_handle)) &&
ACPI_HANDLE(ctlr->dev.parent) == parent_handle) { ACPI_HANDLE(ctlr->dev.parent) == parent_handle) {
/* Apple does not use _CRS but nested devices for SPI slaves */ /* Apple does not use _CRS but nested devices for SPI slaves */
acpi_spi_parse_apple_properties(adev, &lookup); acpi_spi_parse_apple_properties(adev, &lookup);
......
...@@ -1444,7 +1444,7 @@ static bool atpx_present(void) ...@@ -1444,7 +1444,7 @@ static bool atpx_present(void)
dhandle = ACPI_HANDLE(&pdev->dev); dhandle = ACPI_HANDLE(&pdev->dev);
if (dhandle) { if (dhandle) {
status = acpi_get_handle(dhandle, "ATPX", &atpx_handle); status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
if (!ACPI_FAILURE(status)) { if (ACPI_SUCCESS(status)) {
pci_dev_put(pdev); pci_dev_put(pdev);
return true; return true;
} }
...@@ -1454,7 +1454,7 @@ static bool atpx_present(void) ...@@ -1454,7 +1454,7 @@ static bool atpx_present(void)
dhandle = ACPI_HANDLE(&pdev->dev); dhandle = ACPI_HANDLE(&pdev->dev);
if (dhandle) { if (dhandle) {
status = acpi_get_handle(dhandle, "ATPX", &atpx_handle); status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
if (!ACPI_FAILURE(status)) { if (ACPI_SUCCESS(status)) {
pci_dev_put(pdev); pci_dev_put(pdev);
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment