public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: akpm@linux-foundation.org
Cc: linux-acpi@vger.kernel.org, roel.kluin@gmail.com,
	jwoithe@physics.adelaide.edu.au
Subject: Re: [patch 05/12] fujitsu-laptop: fix tests of acpi_evaluate_integer() return
Date: Wed, 25 Nov 2009 00:58:44 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0911250057060.4058@localhost.localdomain> (raw)
In-Reply-To: <200911172227.nAHMRV26023190@imap1.linux-foundation.org>

On Tue, 17 Nov 2009, akpm@linux-foundation.org wrote:

> From: Roel Kluin <roel.kluin@gmail.com>
> 
> The wrong test was used acpi_status status is unsigned.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
> Cc: Len Brown <lenb@kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  drivers/platform/x86/fujitsu-laptop.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff -puN drivers/platform/x86/fujitsu-laptop.c~fujitsu-laptop-fix-tests-of-acpi_evaluate_integer-return drivers/platform/x86/fujitsu-laptop.c
> --- a/drivers/platform/x86/fujitsu-laptop.c~fujitsu-laptop-fix-tests-of-acpi_evaluate_integer-return
> +++ a/drivers/platform/x86/fujitsu-laptop.c
> @@ -376,7 +376,7 @@ static int get_lcd_level(void)
>  
>  	status =
>  	    acpi_evaluate_integer(fujitsu->acpi_handle, "GBLL", NULL, &state);
> -	if (status < 0)
> +	if (ACPI_FAILURE(status))
>  		return status;

as status is a positive number, shouldn't we be returning something like 
-1 here on failure, rather than status?

>  
>  	fujitsu->brightness_level = state & 0x0fffffff;
> @@ -398,7 +398,7 @@ static int get_max_brightness(void)
>  
>  	status =
>  	    acpi_evaluate_integer(fujitsu->acpi_handle, "RBLL", NULL, &state);
> -	if (status < 0)
> +	if (ACPI_FAILURE(status))
>  		return status;
>  
>  	fujitsu->max_brightness = state;
> _
> 

  reply	other threads:[~2009-11-25  5:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17 22:27 [patch 05/12] fujitsu-laptop: fix tests of acpi_evaluate_integer() return akpm
2009-11-25  5:58 ` Len Brown [this message]
2009-11-25  6:29   ` [patch 05/12] fujitsu-laptop: fix tests of acpi_evaluate_integer() Jonathan Woithe
2009-11-25 11:11     ` Roel Kluin
2009-11-26  1:26       ` Jonathan Woithe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.0911250057060.4058@localhost.localdomain \
    --to=lenb@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jwoithe@physics.adelaide.edu.au \
    --cc=linux-acpi@vger.kernel.org \
    --cc=roel.kluin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox