From patchwork Tue May 31 04:46:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Lee X-Patchwork-Id: 831402 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4V4k9VM028378 for ; Tue, 31 May 2011 04:46:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751978Ab1EaEqI (ORCPT ); Tue, 31 May 2011 00:46:08 -0400 Received: from novprvlin0050.provo.novell.com ([137.65.248.33]:53520 "EHLO novprvlin0050.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751288Ab1EaEqH (ORCPT ); Tue, 31 May 2011 00:46:07 -0400 Received: from INET-PRV1-MTA by novprvlin0050.provo.novell.com with Novell_GroupWise; Mon, 30 May 2011 22:46:06 -0600 Message-Id: <4DE4FF2B020000230002D493@novprvlin0050.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Mon, 30 May 2011 22:46:03 -0600 From: "Joey Lee" To: Cc: "Joey Lee" , Subject: Re: bug in acer-wmi.c, wmid3_set_device_status(), initialization of params. Mime-Version: 1.0 Content-Disposition: inline Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 31 May 2011 04:46:09 +0000 (UTC) Hi Joern, ? ??2011-05-30 ? 21:39 -0600?Joey Lee ??? > Hi Joern, > > ? ??2011-05-31 ? 15:03 +1200?Joern Heissler ??? > > Hello, > > > > I think I have found a bug in acer-wmi.c, > > commit 987dfbaa65b2c3568b85e29d2598da08a011ee09: > > > > The function wmid3_set_device_status contains: > > > > struct wmid3_gds_input_param params = { > > .function_num = 0x1, > > .hotkey_number = 0x01, > > .devices = ACER_WMID3_GDS_WIRELESS & > > ACER_WMID3_GDS_THREEG & > > ACER_WMID3_GDS_WIMAX & > > ACER_WMID3_GDS_BLUETOOTH, > > }; > > > > (1<<0) & (1<<6) & (1<<7) & (1<<11) is zero. Meant bitwise or? > > > > OK, it's my mistake, must be OR but not AND. > I will generate a fix patch, I will test it again, please kindly help > test it later. > Please kindly help to review this patch for bitwise bug: >From 57756e3f0c727b07314485833e4b9b557bf158ce Mon Sep 17 00:00:00 2001 From: Lee, Chun-Yi Date: Tue, 31 May 2011 12:36:09 +0800 Subject: [PATCH] acer-wmi: fix bitwise bug when set device state Fix a bitwise bug that was found by Joern Heissler, it must be OR but not AND when we query current device state. Cc: Joern Heissler Signed-off-by: Lee, Chun-Yi --- drivers/platform/x86/acer-wmi.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 005417b..7d4675a 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -1156,9 +1156,9 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device) struct wmid3_gds_input_param params = { .function_num = 0x1, .hotkey_number = 0x01, - .devices = ACER_WMID3_GDS_WIRELESS & - ACER_WMID3_GDS_THREEG & - ACER_WMID3_GDS_WIMAX & + .devices = ACER_WMID3_GDS_WIRELESS | + ACER_WMID3_GDS_THREEG | + ACER_WMID3_GDS_WIMAX | ACER_WMID3_GDS_BLUETOOTH, }; struct acpi_buffer input = {