All of lore.kernel.org
 help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net,
	Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Subject: [PATCH 2/6] thinkpad-acpi: remove uneeded tp_features.hotkey tests in hotkey_exit
Date: Sun, 20 Sep 2009 14:09:23 -0300	[thread overview]
Message-ID: <1253466567-4285-3-git-send-email-hmh@hmh.eng.br> (raw)
In-Reply-To: <1253466567-4285-1-git-send-email-hmh@hmh.eng.br>

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 <hmh@hmh.eng.br>
---
 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)
-- 
1.6.3.3


  parent reply	other threads:[~2009-09-20 17:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-20 17:09 [GIT PATCH] thinkpad-acpi patches for the merge window (second set) Henrique de Moraes Holschuh
2009-09-20 17:09 ` [PATCH 1/6] thinkpad-acpi: don't leave ERR_PTR() pointers around Henrique de Moraes Holschuh
2009-09-20 17:09 ` Henrique de Moraes Holschuh [this message]
2009-09-20 17:09 ` [PATCH 3/6] thinkpad-acpi: drop HKEY event 0x5010 Henrique de Moraes Holschuh
2009-09-20 17:09 ` [PATCH 4/6] thinkpad-acpi: hotkey event driver update Henrique de Moraes Holschuh
2009-09-20 17:09 ` [PATCH 5/6] thinkpad-acpi: add internal hotkey event API Henrique de Moraes Holschuh
2009-09-21 19:09   ` Len Brown
2010-03-10 20:33     ` Henrique de Moraes Holschuh
2009-09-26  8:59   ` Jaswinder Singh Rajput
2009-09-26 13:48     ` Henrique de Moraes Holschuh
2009-09-20 17:09 ` [PATCH 6/6] thinkpad-acpi: name event constants Henrique de Moraes Holschuh
2009-09-26 23:58 ` [GIT PATCH] thinkpad-acpi patches for the merge window (second set) Henrique de Moraes Holschuh

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=1253466567-4285-3-git-send-email-hmh@hmh.eng.br \
    --to=hmh@hmh.eng.br \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.