From patchwork Wed Nov 25 11:11:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 62749 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 nAPBB6wO008385 for ; Wed, 25 Nov 2009 11:11:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbZKYLK7 (ORCPT ); Wed, 25 Nov 2009 06:10:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758353AbZKYLK7 (ORCPT ); Wed, 25 Nov 2009 06:10:59 -0500 Received: from fg-out-1718.google.com ([72.14.220.154]:60229 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752738AbZKYLK6 (ORCPT ); Wed, 25 Nov 2009 06:10:58 -0500 Received: by fg-out-1718.google.com with SMTP id d23so3047921fga.1 for ; Wed, 25 Nov 2009 03:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=dIPXSlqnnCfVMDU4tb7esmJY/FO7IyZhKYSAFdHilLs=; b=bfxttus51uIhB0TWrcU2uI/5xHb5mRKeOpQO9IlTWv4TT/9B/oOg+xZn0NbZOjn+MM /Ms4WeyvakPpFyLLpwYVgrppH5gTg/7dMUeZonPZ8IWVYuT1wpVabwpyaJ/Rl9RkgdDy MliL1mjHzwzEEEbogC/bNhhrfgM9sAzPlEqO0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=GBdmLmCQH5yLjrqKy63THA24nTb1vakn/d53stu1wwBw4fZAZYgziXFkBKWK8PlJbe iLS+hPg+cGh28vtYEe1PKpw1ai/TzOLO+wFa+86o7WgFXD9LCG5OnJFi0YvVECUxmBQX mcfSf2KM5tSicpIVJa3Hj1/CMH04n1FlFxbpo= Received: by 10.86.11.6 with SMTP id 6mr6533935fgk.27.1259147461909; Wed, 25 Nov 2009 03:11:01 -0800 (PST) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id e20sm15550301fga.22.2009.11.25.03.10.59 (version=SSLv3 cipher=RC4-MD5); Wed, 25 Nov 2009 03:11:00 -0800 (PST) Message-ID: <4B0D10C7.6080603@gmail.com> Date: Wed, 25 Nov 2009 12:11:03 +0100 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: Jonathan Woithe CC: Len Brown , akpm@linux-foundation.org, linux-acpi@vger.kernel.org Subject: Re: [patch 05/12] fujitsu-laptop: fix tests of acpi_evaluate_integer() References: <200911250629.nAP6TL2u009406@turbo.physics.adelaide.edu.au> In-Reply-To: <200911250629.nAP6TL2u009406@turbo.physics.adelaide.edu.au> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index bcd4ba8..714c472 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -376,8 +376,10 @@ 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)) { + pr_warning("%s failed, acpi error: %u\n", __func__, status); + return -EINVAL; + } fujitsu->brightness_level = state & 0x0fffffff; @@ -398,8 +400,10 @@ 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)) { + pr_warning("%s failed, acpi error: %u\n", __func__, status); + return -EINVAL; + } fujitsu->max_brightness = state;