From patchwork Wed Nov 25 06:29:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Woithe X-Patchwork-Id: 62693 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAP6dVNo028730 for ; Wed, 25 Nov 2009 06:39:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751976AbZKYGjX (ORCPT ); Wed, 25 Nov 2009 01:39:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752000AbZKYGjX (ORCPT ); Wed, 25 Nov 2009 01:39:23 -0500 Received: from adelphi.physics.adelaide.edu.au ([129.127.102.1]:45684 "EHLO adelphi.physics.adelaide.edu.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbZKYGjX (ORCPT ); Wed, 25 Nov 2009 01:39:23 -0500 X-Greylist: delayed 519 seconds by postgrey-1.27 at vger.kernel.org; Wed, 25 Nov 2009 01:39:22 EST Received: from turbo.physics.adelaide.edu.au (IDENT:0@turbo [129.127.102.108]) by adelphi.physics.adelaide.edu.au (8.13.7/8.13.7/UofA-Physics-1.0) with ESMTP id nAP6TOBZ026037; Wed, 25 Nov 2009 16:59:24 +1030 Received: from turbo.physics.adelaide.edu.au (IDENT:7157@localhost [127.0.0.1]) by turbo.physics.adelaide.edu.au (8.13.4/8.13.4) with ESMTP id nAP6TOfl009407; Wed, 25 Nov 2009 16:59:24 +1030 Received: (from jwoithe@localhost) by turbo.physics.adelaide.edu.au (8.13.4/8.13.4/Submit) id nAP6TL2u009406; Wed, 25 Nov 2009 16:59:21 +1030 From: Jonathan Woithe Message-Id: <200911250629.nAP6TL2u009406@turbo.physics.adelaide.edu.au> Subject: Re: [patch 05/12] fujitsu-laptop: fix tests of acpi_evaluate_integer() To: lenb@kernel.org (Len Brown) Date: Wed, 25 Nov 2009 16:59:21 +1030 (CST) Cc: akpm@linux-foundation.org, linux-acpi@vger.kernel.org, roel.kluin@gmail.com, jwoithe@physics.adelaide.edu.au In-Reply-To: from "Len Brown" at Nov 25, 2009 12:58:44 AM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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) - return status; + if (ACPI_FAILURE(status)) + return -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) - return status; + if (ACPI_FAILURE(status)) + return -status; fujitsu->max_brightness = state;