From patchwork Wed Apr 5 06:50:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= X-Patchwork-Id: 9663067 X-Patchwork-Delegate: dvhart@infradead.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A34BF60353 for ; Wed, 5 Apr 2017 06:51:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93E2028507 for ; Wed, 5 Apr 2017 06:51:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87D5D2851F; Wed, 5 Apr 2017 06:51:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1ED2328507 for ; Wed, 5 Apr 2017 06:51:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752273AbdDEGv2 (ORCPT ); Wed, 5 Apr 2017 02:51:28 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:32773 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753494AbdDEGu3 (ORCPT ); Wed, 5 Apr 2017 02:50:29 -0400 Received: by mail-lf0-f67.google.com with SMTP id r36so359331lfi.0 for ; Tue, 04 Apr 2017 23:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kempniu.pl; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t7XYkYtUPOM2ljwYvGlOFsyhEhdTfjilStDgAX5hMKY=; b=KOqQKHXgt7ZT3BEkYnGpb0MnDU+yrhgFRbVTcCPJ7egOOpiejSjEY3GsaCSBdl+AMJ 1gpnTvSJbx8DRHRz3wqayfWE1aQ5Qq3GP5JKaokGsRzZ5/ZmFzUXcgDDlqOmCHvfRuW8 Ez0gonMk3OzsufZQaERRsBZA/CWBemgtUV3ug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t7XYkYtUPOM2ljwYvGlOFsyhEhdTfjilStDgAX5hMKY=; b=uYNgDj1MKjsiNG2/5LlxaLjcOmTG7cPSrmX/G3aLfwL75HVF4tOCp4KyKiNK17w1n+ VCFbpbUc8l4pHMJdBE52H8LOHVt0p/YTYuJtIuMikE9dIoPI1QrmU/jhgNFZtLDtl4J2 6m3e83tEgradmanmNHiayK3IGz0NxJYH0fgB0haI1R2dp/xsNJRUBHBj2xyysyt6f84e bJRSQQaOIsDEoZM2LRR9uifXlDZAFM1u9awHPFfYxe79PhTD8XSGGXgbtGJU8IE6EWPO CeVvx4HTuTnrTc7pXt4fnVv1hQre8TXJIuu/AVeClpsQZXjG6UZ6sWatmQye8N8njQzH C1xg== X-Gm-Message-State: AFeK/H3o4n3ookSpXCL+APxuwGVvkD4HM1iBmeIYYGxRsVVt3OHO+vJG1dtwQah1jN+deA== X-Received: by 10.25.115.144 with SMTP id h16mr8070510lfk.46.1491375028215; Tue, 04 Apr 2017 23:50:28 -0700 (PDT) Received: from ozzy.nask.waw.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id y15sm3529067ljd.41.2017.04.04.23.50.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 23:50:27 -0700 (PDT) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Jonathan Woithe , Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] platform/x86: fujitsu-laptop: simplify call_fext_func() Date: Wed, 5 Apr 2017 08:50:22 +0200 Message-Id: <20170405065023.3267-3-kernel@kempniu.pl> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170405065023.3267-1-kernel@kempniu.pl> References: <20170405065023.3267-1-kernel@kempniu.pl> MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP acpi_evaluate_integer() takes a pathname parameter which contains the name of the entity to evaluate underneath the given handle, so calling acpi_get_handle() beforehand is redundant. Replace the call to acpi_get_handle() with a call to acpi_evaluate_integer(), thus eliminating the need for a local variable storing the handle. Update debug message to reflect this change. Adjust whitespace to make checkpatch happy. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index ca1491ff659e..8c41968d9e7f 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -228,20 +228,11 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2) struct acpi_object_list arg_list = { 4, params }; unsigned long long value; acpi_status status; - acpi_handle handle; - status = acpi_get_handle(fujitsu_laptop->acpi_handle, "FUNC", &handle); + status = acpi_evaluate_integer(fujitsu_laptop->acpi_handle, "FUNC", + &arg_list, &value); if (ACPI_FAILURE(status)) { - vdbg_printk(FUJLAPTOP_DBG_ERROR, - "FUNC interface is not present\n"); - return -ENODEV; - } - - status = acpi_evaluate_integer(handle, NULL, &arg_list, &value); - if (ACPI_FAILURE(status)) { - vdbg_printk(FUJLAPTOP_DBG_WARN, - "FUNC 0x%x (args 0x%x, 0x%x, 0x%x) call failed\n", - cmd, arg0, arg1, arg2); + vdbg_printk(FUJLAPTOP_DBG_ERROR, "Failed to evaluate FUNC\n"); return -ENODEV; }