From patchwork Thu Dec 10 13:18:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anisse Astier X-Patchwork-Id: 66259 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 nBADSZLa018160 for ; Thu, 10 Dec 2009 13:28:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760472AbZLJN1t (ORCPT ); Thu, 10 Dec 2009 08:27:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760303AbZLJN1r (ORCPT ); Thu, 10 Dec 2009 08:27:47 -0500 Received: from ey-out-2122.google.com ([74.125.78.26]:7370 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759502AbZLJN1m (ORCPT ); Thu, 10 Dec 2009 08:27:42 -0500 Received: by ey-out-2122.google.com with SMTP id 4so351805eyf.5 for ; Thu, 10 Dec 2009 05:27:46 -0800 (PST) Received: by 10.213.97.30 with SMTP id j30mr2681163ebn.94.1260451666694; Thu, 10 Dec 2009 05:27:46 -0800 (PST) Received: from localhost.localdomain (253.175.70-86.rev.gaoland.net [86.70.175.253]) by mx.google.com with ESMTPS id 14sm508811ewy.11.2009.12.10.05.27.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 10 Dec 2009 05:27:46 -0800 (PST) From: Anisse Astier To: linux-acpi@vger.kernel.org, linux-input@vger.kernel.org Cc: Dmitry Torokhov , Len Brown , Matthew Garrett , Thomas Renninger , Carlos Corbacho , Matt Chen , Anisse Astier Subject: [PATCH 6/7] msi-wmi: replace one-condition switch-case with if statement Date: Thu, 10 Dec 2009 14:18:18 +0100 Message-Id: <1260451099-25620-7-git-send-email-anisse@astier.eu> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <1260451099-25620-1-git-send-email-anisse@astier.eu> References: <1260451099-25620-1-git-send-email-anisse@astier.eu> 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/msi-wmi.c b/drivers/platform/x86/msi-wmi.c index d757935..2c2afc1 100644 --- a/drivers/platform/x86/msi-wmi.c +++ b/drivers/platform/x86/msi-wmi.c @@ -243,14 +243,10 @@ static void msi_wmi_notify(u32 value, void *context) } key->last_pressed = cur; - switch (key->type) { - case KE_KEY: - /* Brightness is served via acpi video driver */ - if (!backlight && - (key->keycode == KEY_BRIGHTNESSUP || - key->keycode == KEY_BRIGHTNESSDOWN)) - break; - + if (key->type == KE_KEY && + /* Brightness is served via acpi video driver */ + (backlight || (key->keycode != KEY_BRIGHTNESSUP && + key->keycode != KEY_BRIGHTNESSDOWN))) { dprintk("Send key: 0x%X - " "Input layer keycode: %d\n", key->code, key->keycode); @@ -260,7 +256,6 @@ static void msi_wmi_notify(u32 value, void *context) input_report_key(msi_wmi_input_dev, key->keycode, 0); input_sync(msi_wmi_input_dev); - break; } } else printk(KERN_INFO "Unknown key pressed - %x\n",