From patchwork Sun Sep 20 17:09:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrique de Moraes Holschuh X-Patchwork-Id: 48918 X-Patchwork-Delegate: lenb@kernel.org 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 n8KHA3qt012371 for ; Sun, 20 Sep 2009 17:10:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754737AbZITRKQ (ORCPT ); Sun, 20 Sep 2009 13:10:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754767AbZITRKP (ORCPT ); Sun, 20 Sep 2009 13:10:15 -0400 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:36479 "EHLO out1.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754737AbZITRKP (ORCPT ); Sun, 20 Sep 2009 13:10:15 -0400 Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id D44A869678; Sun, 20 Sep 2009 13:10:18 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 20 Sep 2009 13:10:20 -0400 X-Sasl-enc: LryRwS++IsplQgBHx3nww5O4qkrfupGTU1mwEUmVpF/C 1253466618 Received: from thorin.khazad-dum.debian.net (187-27-2-224.3g.claro.net.br [187.27.2.224]) by mail.messagingengine.com (Postfix) with ESMTPSA id 4CEBE1071E; Sun, 20 Sep 2009 13:10:18 -0400 (EDT) Received: by thorin.khazad-dum.debian.net (Postfix, from userid 1000) id E77E61E9A7C; Sun, 20 Sep 2009 14:09:30 -0300 (BRT) From: Henrique de Moraes Holschuh To: Len Brown Cc: linux-acpi@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, Henrique de Moraes Holschuh Subject: [PATCH 2/6] thinkpad-acpi: remove uneeded tp_features.hotkey tests in hotkey_exit Date: Sun, 20 Sep 2009 14:09:23 -0300 Message-Id: <1253466567-4285-3-git-send-email-hmh@hmh.eng.br> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1253466567-4285-1-git-send-email-hmh@hmh.eng.br> References: <1253466567-4285-1-git-send-email-hmh@hmh.eng.br> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org hotkey_exit() is only called if hotkey_init() finished sucessfully, or by direct calls inside hotkey_init(). The tp_features.hotkey test is always true, and just adds to the confusion, remove it. Also, avoid calling hotkey_mask_set() when it won't do anything useful. Signed-off-by: Henrique de Moraes Holschuh --- drivers/platform/x86/thinkpad_acpi.c | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index b789ee8..1b4d6f6 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -2843,16 +2843,14 @@ static void hotkey_exit(void) kfree(hotkey_keycode_map); - if (tp_features.hotkey) { - dbg_printk(TPACPI_DBG_EXIT | TPACPI_DBG_HKEY, - "restoring original hot key mask\n"); - /* no short-circuit boolean operator below! */ - if ((hotkey_mask_set(hotkey_orig_mask) | - hotkey_status_set(false)) != 0) - printk(TPACPI_ERR - "failed to restore hot key mask " - "to BIOS defaults\n"); - } + dbg_printk(TPACPI_DBG_EXIT | TPACPI_DBG_HKEY, + "restoring original hot key mask\n"); + /* no short-circuit boolean operator below! */ + if (((tp_features.hotkey_mask && hotkey_mask_set(hotkey_orig_mask)) + | hotkey_status_set(false)) != 0) + printk(TPACPI_ERR + "failed to restore hot key mask " + "to BIOS defaults\n"); } static void __init hotkey_unmap(const unsigned int scancode)