linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI / PM: Do not apply ACPI_SUCCESS() to acpi_bus_get_device() result
@ 2012-12-16 13:32 Rafael J. Wysocki
  2012-12-16 15:59 ` Mika Westerberg
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2012-12-16 13:32 UTC (permalink / raw)
  To: ACPI Devel Maling List; +Cc: LKML, Linux PM list, Mika Westerberg

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Since the return value of acpi_bus_get_device() is not of type
acpi_status, ACPI_SUCCESS() should not be used for checking its
return value.  Fix that.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/device_pm.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux/drivers/acpi/device_pm.c
===================================================================
--- linux.orig/drivers/acpi/device_pm.c
+++ linux/drivers/acpi/device_pm.c
@@ -358,8 +358,7 @@ static struct acpi_device *acpi_dev_pm_g
 	acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
 	struct acpi_device *adev;
 
-	return handle && ACPI_SUCCESS(acpi_bus_get_device(handle, &adev)) ?
-		adev : NULL;
+	return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
 }
 
 /**


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ACPI / PM: Do not apply ACPI_SUCCESS() to acpi_bus_get_device() result
  2012-12-16 13:32 [PATCH] ACPI / PM: Do not apply ACPI_SUCCESS() to acpi_bus_get_device() result Rafael J. Wysocki
@ 2012-12-16 15:59 ` Mika Westerberg
  0 siblings, 0 replies; 2+ messages in thread
From: Mika Westerberg @ 2012-12-16 15:59 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: ACPI Devel Maling List, LKML, Linux PM list

On Sun, Dec 16, 2012 at 02:32:06PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Since the return value of acpi_bus_get_device() is not of type
> acpi_status, ACPI_SUCCESS() should not be used for checking its
> return value.  Fix that.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

> ---
>  drivers/acpi/device_pm.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> Index: linux/drivers/acpi/device_pm.c
> ===================================================================
> --- linux.orig/drivers/acpi/device_pm.c
> +++ linux/drivers/acpi/device_pm.c
> @@ -358,8 +358,7 @@ static struct acpi_device *acpi_dev_pm_g
>  	acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
>  	struct acpi_device *adev;
>  
> -	return handle && ACPI_SUCCESS(acpi_bus_get_device(handle, &adev)) ?
> -		adev : NULL;
> +	return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
>  }
>  
>  /**

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-16 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-16 13:32 [PATCH] ACPI / PM: Do not apply ACPI_SUCCESS() to acpi_bus_get_device() result Rafael J. Wysocki
2012-12-16 15:59 ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).