lkml.org 
[lkml]   [2012]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ACPI / PM: Do not apply ACPI_SUCCESS() to acpi_bus_get_device() result
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;
> }
>
> /**


\
 
 \ /
  Last update: 2012-12-16 17:21    [W:0.050 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site