* Re: [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE
2021-01-26 20:23 [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE Bjorn Helgaas
@ 2021-01-27 2:17 ` Guenter Roeck
2021-01-27 4:46 ` Deucher, Alexander
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2021-01-27 2:17 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Rafael J . Wysocki, Len Brown, Alex Deucher,
Christian König, Jean Delvare, Corentin Chary, Mark Brown,
Jaroslav Kysela, Takashi Iwai, linux-spi, acpi4asus-user,
linux-hwmon, amd-gfx, alsa-devel, linux-acpi, Bjorn Helgaas
On Tue, Jan 26, 2021 at 02:23:17PM -0600, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> 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>
> ---
>
> This isn't really an ACPI patch, but I'm sending it to you, Rafael, since
> it seems easier to just apply these all at once. But I'd be happy to split
> them up into individual patches if you'd rather.
>
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 4 ++--
> drivers/gpu/drm/radeon/radeon_bios.c | 4 ++--
> drivers/hwmon/acpi_power_meter.c | 4 ++--
Acked-by: Guenter Roeck <linux@roeck-us.net>
> drivers/platform/x86/asus-laptop.c | 6 +++---
> drivers/spi/spi.c | 2 +-
> sound/pci/hda/hda_intel.c | 4 ++--
> 6 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> index 6333cada1e09..055f600eeed8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> @@ -291,7 +291,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> @@ -304,7 +304,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c
> index bb29cf02974d..43bbbfd6ade8 100644
> --- a/drivers/gpu/drm/radeon/radeon_bios.c
> +++ b/drivers/gpu/drm/radeon/radeon_bios.c
> @@ -205,7 +205,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> @@ -218,7 +218,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> 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);
>
> diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
> index 0edafe687fa9..bfea656e910c 100644
> --- a/drivers/platform/x86/asus-laptop.c
> +++ b/drivers/platform/x86/asus-laptop.c
> @@ -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.
> */
> 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",
> (uint) temp);
> /*
> @@ -873,7 +873,7 @@ static ssize_t infos_show(struct device *dev, struct device_attribute *attr,
> * takes several seconds to run on some systems.
> */
> 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",
> (uint) temp);
> /*
> @@ -884,7 +884,7 @@ static ssize_t infos_show(struct device *dev, struct device_attribute *attr,
> * silently ignored.
> */
> 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",
> (uint) temp);
> if (asus->dsdt_info) {
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 720ab34784c1..801d8b499788 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -2210,7 +2210,7 @@ static acpi_status acpi_register_spi_device(struct spi_controller *ctlr,
> return AE_OK;
>
> 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) {
> /* Apple does not use _CRS but nested devices for SPI slaves */
> acpi_spi_parse_apple_properties(adev, &lookup);
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index 770ad25f1907..fe8049cd2765 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -1444,7 +1444,7 @@ static bool atpx_present(void)
> dhandle = ACPI_HANDLE(&pdev->dev);
> if (dhandle) {
> status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> pci_dev_put(pdev);
> return true;
> }
> @@ -1454,7 +1454,7 @@ static bool atpx_present(void)
> dhandle = ACPI_HANDLE(&pdev->dev);
> if (dhandle) {
> status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> pci_dev_put(pdev);
> return true;
> }
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE
2021-01-26 20:23 [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE Bjorn Helgaas
2021-01-27 2:17 ` Guenter Roeck
@ 2021-01-27 4:46 ` Deucher, Alexander
2021-01-27 6:50 ` Takashi Iwai
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Deucher, Alexander @ 2021-01-27 4:46 UTC (permalink / raw)
To: Bjorn Helgaas, Rafael J . Wysocki, Len Brown, Koenig, Christian,
Jean Delvare, Guenter Roeck, Corentin Chary, Mark Brown,
Jaroslav Kysela, Takashi Iwai
Cc: linux-spi, acpi4asus-user, linux-hwmon, amd-gfx, alsa-devel,
linux-acpi, Bjorn Helgaas
[AMD Public Use]
> -----Original Message-----
> From: Bjorn Helgaas <helgaas@kernel.org>
> Sent: Tuesday, January 26, 2021 3:23 PM
> To: Rafael J . Wysocki <rjw@rjwysocki.net>; Len Brown <lenb@kernel.org>;
> Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
> <Christian.Koenig@amd.com>; Jean Delvare <jdelvare@suse.com>; Guenter
> Roeck <linux@roeck-us.net>; Corentin Chary <corentin.chary@gmail.com>;
> Mark Brown <broonie@kernel.org>; Jaroslav Kysela <perex@perex.cz>;
> Takashi Iwai <tiwai@suse.com>
> Cc: linux-spi@vger.kernel.org; acpi4asus-user@lists.sourceforge.net; linux-
> hwmon@vger.kernel.org; amd-gfx@lists.freedesktop.org; alsa-devel@alsa-
> project.org; linux-acpi@vger.kernel.org; Bjorn Helgaas
> <bhelgaas@google.com>
> Subject: [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE
>
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> 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>
> ---
>
> This isn't really an ACPI patch, but I'm sending it to you, Rafael, since it seems
> easier to just apply these all at once. But I'd be happy to split them up into
> individual patches if you'd rather.
>
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 4 ++--
> drivers/gpu/drm/radeon/radeon_bios.c | 4 ++--
For radeon and amdgpu:
Acked-by: Alex Deucher <alexander.deucher@amd.com>
> drivers/hwmon/acpi_power_meter.c | 4 ++--
> drivers/platform/x86/asus-laptop.c | 6 +++---
> drivers/spi/spi.c | 2 +-
> sound/pci/hda/hda_intel.c | 4 ++--
> 6 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> index 6333cada1e09..055f600eeed8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> @@ -291,7 +291,7 @@ static bool amdgpu_atrm_get_bios(struct
> amdgpu_device *adev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> @@ -304,7 +304,7 @@ static bool amdgpu_atrm_get_bios(struct
> amdgpu_device *adev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM",
> &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> diff --git a/drivers/gpu/drm/radeon/radeon_bios.c
> b/drivers/gpu/drm/radeon/radeon_bios.c
> index bb29cf02974d..43bbbfd6ade8 100644
> --- a/drivers/gpu/drm/radeon/radeon_bios.c
> +++ b/drivers/gpu/drm/radeon/radeon_bios.c
> @@ -205,7 +205,7 @@ static bool radeon_atrm_get_bios(struct
> radeon_device *rdev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> @@ -218,7 +218,7 @@ static bool radeon_atrm_get_bios(struct
> radeon_device *rdev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM",
> &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> 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);
>
> diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-
> laptop.c
> index 0edafe687fa9..bfea656e910c 100644
> --- a/drivers/platform/x86/asus-laptop.c
> +++ b/drivers/platform/x86/asus-laptop.c
> @@ -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.
> */
> 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",
> (uint) temp);
> /*
> @@ -873,7 +873,7 @@ static ssize_t infos_show(struct device *dev, struct
> device_attribute *attr,
> * takes several seconds to run on some systems.
> */
> 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",
> (uint) temp);
> /*
> @@ -884,7 +884,7 @@ static ssize_t infos_show(struct device *dev, struct
> device_attribute *attr,
> * silently ignored.
> */
> 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",
> (uint) temp);
> if (asus->dsdt_info) {
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index
> 720ab34784c1..801d8b499788 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -2210,7 +2210,7 @@ static acpi_status acpi_register_spi_device(struct
> spi_controller *ctlr,
> return AE_OK;
>
> 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) {
> /* Apple does not use _CRS but nested devices for SPI slaves
> */
> acpi_spi_parse_apple_properties(adev, &lookup); diff --git
> a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index
> 770ad25f1907..fe8049cd2765 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -1444,7 +1444,7 @@ static bool atpx_present(void)
> dhandle = ACPI_HANDLE(&pdev->dev);
> if (dhandle) {
> status = acpi_get_handle(dhandle, "ATPX",
> &atpx_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> pci_dev_put(pdev);
> return true;
> }
> @@ -1454,7 +1454,7 @@ static bool atpx_present(void)
> dhandle = ACPI_HANDLE(&pdev->dev);
> if (dhandle) {
> status = acpi_get_handle(dhandle, "ATPX",
> &atpx_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> pci_dev_put(pdev);
> return true;
> }
> --
> 2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE
2021-01-26 20:23 [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE Bjorn Helgaas
2021-01-27 2:17 ` Guenter Roeck
2021-01-27 4:46 ` Deucher, Alexander
@ 2021-01-27 6:50 ` Takashi Iwai
2021-01-27 11:28 ` Mark Brown
2021-01-27 15:14 ` Bjorn Helgaas
4 siblings, 0 replies; 9+ messages in thread
From: Takashi Iwai @ 2021-01-27 6:50 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Rafael J . Wysocki, Len Brown, Alex Deucher,
Christian König, Jean Delvare, Guenter Roeck,
Corentin Chary, Mark Brown, Jaroslav Kysela, Takashi Iwai,
linux-spi, acpi4asus-user, linux-hwmon, amd-gfx, alsa-devel,
linux-acpi, Bjorn Helgaas
On Tue, 26 Jan 2021 21:23:17 +0100,
Bjorn Helgaas wrote:
>
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> 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>
> ---
>
> This isn't really an ACPI patch, but I'm sending it to you, Rafael, since
> it seems easier to just apply these all at once. But I'd be happy to split
> them up into individual patches if you'd rather.
>
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 4 ++--
> drivers/gpu/drm/radeon/radeon_bios.c | 4 ++--
> drivers/hwmon/acpi_power_meter.c | 4 ++--
> drivers/platform/x86/asus-laptop.c | 6 +++---
> drivers/spi/spi.c | 2 +-
> sound/pci/hda/hda_intel.c | 4 ++--
For the sound/*:
Acked-by: Takashi Iwai <tiwai@suse.de>
thanks,
Takashi
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE
2021-01-26 20:23 [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE Bjorn Helgaas
` (2 preceding siblings ...)
2021-01-27 6:50 ` Takashi Iwai
@ 2021-01-27 11:28 ` Mark Brown
2021-01-27 15:14 ` Bjorn Helgaas
4 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2021-01-27 11:28 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Rafael J . Wysocki, Len Brown, Alex Deucher,
Christian König, Jean Delvare, Guenter Roeck,
Corentin Chary, Jaroslav Kysela, Takashi Iwai, linux-spi,
acpi4asus-user, linux-hwmon, amd-gfx, alsa-devel, linux-acpi,
Bjorn Helgaas
[-- Attachment #1: Type: text/plain, Size: 281 bytes --]
On Tue, Jan 26, 2021 at 02:23:17PM -0600, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> The double negative makes it hard to read "if (!ACPI_FAILURE(status))".
> Replace it with "if (ACPI_SUCCESS(status))".
Acked-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE
2021-01-26 20:23 [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE Bjorn Helgaas
` (3 preceding siblings ...)
2021-01-27 11:28 ` Mark Brown
@ 2021-01-27 15:14 ` Bjorn Helgaas
2021-01-27 15:44 ` Rafael J. Wysocki
4 siblings, 1 reply; 9+ messages in thread
From: Bjorn Helgaas @ 2021-01-27 15:14 UTC (permalink / raw)
To: Rafael J . Wysocki, Len Brown, Alex Deucher,
Christian König, Jean Delvare, Guenter Roeck,
Corentin Chary, Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: linux-spi, acpi4asus-user, linux-hwmon, amd-gfx, alsa-devel,
linux-acpi, Bjorn Helgaas
On Tue, Jan 26, 2021 at 02:23:17PM -0600, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> 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>
> ---
>
> This isn't really an ACPI patch, but I'm sending it to you, Rafael, since
> it seems easier to just apply these all at once. But I'd be happy to split
> them up into individual patches if you'd rather.
Thanks, everybody. Rafael, I'll just merge this via my tree to avoid
burdening you.
> drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 4 ++--
> drivers/gpu/drm/radeon/radeon_bios.c | 4 ++--
> drivers/hwmon/acpi_power_meter.c | 4 ++--
> drivers/platform/x86/asus-laptop.c | 6 +++---
> drivers/spi/spi.c | 2 +-
> sound/pci/hda/hda_intel.c | 4 ++--
> 6 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> index 6333cada1e09..055f600eeed8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> @@ -291,7 +291,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> @@ -304,7 +304,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c
> index bb29cf02974d..43bbbfd6ade8 100644
> --- a/drivers/gpu/drm/radeon/radeon_bios.c
> +++ b/drivers/gpu/drm/radeon/radeon_bios.c
> @@ -205,7 +205,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> @@ -218,7 +218,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev)
> continue;
>
> status = acpi_get_handle(dhandle, "ATRM", &atrm_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> found = true;
> break;
> }
> 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);
>
> diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
> index 0edafe687fa9..bfea656e910c 100644
> --- a/drivers/platform/x86/asus-laptop.c
> +++ b/drivers/platform/x86/asus-laptop.c
> @@ -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.
> */
> 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",
> (uint) temp);
> /*
> @@ -873,7 +873,7 @@ static ssize_t infos_show(struct device *dev, struct device_attribute *attr,
> * takes several seconds to run on some systems.
> */
> 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",
> (uint) temp);
> /*
> @@ -884,7 +884,7 @@ static ssize_t infos_show(struct device *dev, struct device_attribute *attr,
> * silently ignored.
> */
> 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",
> (uint) temp);
> if (asus->dsdt_info) {
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 720ab34784c1..801d8b499788 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -2210,7 +2210,7 @@ static acpi_status acpi_register_spi_device(struct spi_controller *ctlr,
> return AE_OK;
>
> 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) {
> /* Apple does not use _CRS but nested devices for SPI slaves */
> acpi_spi_parse_apple_properties(adev, &lookup);
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index 770ad25f1907..fe8049cd2765 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -1444,7 +1444,7 @@ static bool atpx_present(void)
> dhandle = ACPI_HANDLE(&pdev->dev);
> if (dhandle) {
> status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> pci_dev_put(pdev);
> return true;
> }
> @@ -1454,7 +1454,7 @@ static bool atpx_present(void)
> dhandle = ACPI_HANDLE(&pdev->dev);
> if (dhandle) {
> status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
> - if (!ACPI_FAILURE(status)) {
> + if (ACPI_SUCCESS(status)) {
> pci_dev_put(pdev);
> return true;
> }
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE
2021-01-27 15:14 ` Bjorn Helgaas
@ 2021-01-27 15:44 ` Rafael J. Wysocki
2021-01-27 16:06 ` Bjorn Helgaas
0 siblings, 1 reply; 9+ messages in thread
From: Rafael J. Wysocki @ 2021-01-27 15:44 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Rafael J . Wysocki, Len Brown, Alex Deucher,
Christian König, Jean Delvare, Guenter Roeck,
Corentin Chary, Mark Brown, Jaroslav Kysela, Takashi Iwai,
linux-spi, acpi4asus-user, linux-hwmon, amd-gfx list,
moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
ACPI Devel Maling List, Bjorn Helgaas
On Wed, Jan 27, 2021 at 4:16 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> On Tue, Jan 26, 2021 at 02:23:17PM -0600, Bjorn Helgaas wrote:
> > From: Bjorn Helgaas <bhelgaas@google.com>
> >
> > 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>
> > ---
> >
> > This isn't really an ACPI patch, but I'm sending it to you, Rafael, since
> > it seems easier to just apply these all at once. But I'd be happy to split
> > them up into individual patches if you'd rather.
>
> Thanks, everybody. Rafael, I'll just merge this via my tree to avoid
> burdening you.
It may conflict with some janitorial stuff I'm doing, though, so
unless you've already applied it, I'd prefer to take it via the ACPI
tree.
Cheers!
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE
2021-01-27 15:44 ` Rafael J. Wysocki
@ 2021-01-27 16:06 ` Bjorn Helgaas
2021-01-27 17:44 ` Rafael J. Wysocki
0 siblings, 1 reply; 9+ messages in thread
From: Bjorn Helgaas @ 2021-01-27 16:06 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Rafael J . Wysocki, Len Brown, Alex Deucher,
Christian König, Jean Delvare, Guenter Roeck,
Corentin Chary, Mark Brown, Jaroslav Kysela, Takashi Iwai,
linux-spi, acpi4asus-user, linux-hwmon, amd-gfx list,
moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
ACPI Devel Maling List, Bjorn Helgaas
On Wed, Jan 27, 2021 at 04:44:02PM +0100, Rafael J. Wysocki wrote:
> On Wed, Jan 27, 2021 at 4:16 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> >
> > On Tue, Jan 26, 2021 at 02:23:17PM -0600, Bjorn Helgaas wrote:
> > > From: Bjorn Helgaas <bhelgaas@google.com>
> > >
> > > 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>
> > > ---
> > >
> > > This isn't really an ACPI patch, but I'm sending it to you, Rafael, since
> > > it seems easier to just apply these all at once. But I'd be happy to split
> > > them up into individual patches if you'd rather.
> >
> > Thanks, everybody. Rafael, I'll just merge this via my tree to avoid
> > burdening you.
>
> It may conflict with some janitorial stuff I'm doing, though, so
> unless you've already applied it, I'd prefer to take it via the ACPI
> tree.
No problem, it's all yours!
Bjorn
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE
2021-01-27 16:06 ` Bjorn Helgaas
@ 2021-01-27 17:44 ` Rafael J. Wysocki
0 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2021-01-27 17:44 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Rafael J. Wysocki, Rafael J . Wysocki, Len Brown, Alex Deucher,
Christian König, Jean Delvare, Guenter Roeck,
Corentin Chary, Mark Brown, Jaroslav Kysela, Takashi Iwai,
linux-spi, acpi4asus-user, linux-hwmon, amd-gfx list,
moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
ACPI Devel Maling List, Bjorn Helgaas
On Wed, Jan 27, 2021 at 5:06 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> On Wed, Jan 27, 2021 at 04:44:02PM +0100, Rafael J. Wysocki wrote:
> > On Wed, Jan 27, 2021 at 4:16 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> > >
> > > On Tue, Jan 26, 2021 at 02:23:17PM -0600, Bjorn Helgaas wrote:
> > > > From: Bjorn Helgaas <bhelgaas@google.com>
> > > >
> > > > 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>
> > > > ---
> > > >
> > > > This isn't really an ACPI patch, but I'm sending it to you, Rafael, since
> > > > it seems easier to just apply these all at once. But I'd be happy to split
> > > > them up into individual patches if you'd rather.
> > >
> > > Thanks, everybody. Rafael, I'll just merge this via my tree to avoid
> > > burdening you.
> >
> > It may conflict with some janitorial stuff I'm doing, though, so
> > unless you've already applied it, I'd prefer to take it via the ACPI
> > tree.
>
> No problem, it's all yours!
Applied as 5.12 material with the ACKs, thanks!
^ permalink raw reply [flat|nested] 9+ messages in thread