From patchwork Tue Jun 20 09:06:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chun-Yi Lee X-Patchwork-Id: 9798819 X-Patchwork-Delegate: andy.shevchenko@gmail.com 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 C5067601BC for ; Tue, 20 Jun 2017 09:07:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA8BB23E64 for ; Tue, 20 Jun 2017 09:07:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC09E283AF; Tue, 20 Jun 2017 09:07:59 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 44B5A23E64 for ; Tue, 20 Jun 2017 09:07:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752123AbdFTJGm (ORCPT ); Tue, 20 Jun 2017 05:06:42 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:33932 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083AbdFTJGk (ORCPT ); Tue, 20 Jun 2017 05:06:40 -0400 Received: by mail-pg0-f66.google.com with SMTP id j186so20064013pge.1; Tue, 20 Jun 2017 02:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JckxIySkkyY8B0PlBY2l2BiF6H7lnPRy7AQ4AzMyN8Q=; b=djdmJknDjMPoS9UCkIDbI0VPe7gaZKz1QJ5D/T0UJF420saAClBomnHGBarhe1iZ48 dayUwiLqxja0znvqpUmkbMX83dtamlz6rYeWXpb3/iAhWwlELBvBORQZfpopLXAn1IUu gnmkEfOuYfXO7CzXrJV2sF+KXNGND5Dgpe/QXgbP+ROz520So/C9dRQS4B096P+9oJeT ABDHNdcqXXWOCinFPtW0afH9gP7ZnMwTb/zdXuJHSxGA5NmRQ7MRbvFRh3g8bnOAheDF hKpp9ssl+anmYdP4HtZZE5StPIco1Svsfz/vbA60hVzRVOdpb4U+hzuNvbGEGFZRCorE QLzw== 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:mime-version :content-transfer-encoding; bh=JckxIySkkyY8B0PlBY2l2BiF6H7lnPRy7AQ4AzMyN8Q=; b=e/G6C8kYASKuC2p2Y1IIKCZ1YeWdOXIQAi15hytMwr5BBkofOGOo/06bd9ydJIyy3c Dm1SU/QYE44Llu66y+2PKt/JYVMmwO6Ldx2o6AcjnSZGDe7JFOhTO1fN9sP7cNdMlcj1 LlwYLhXBVOcRGNI0H9XBVgjUxGnMJ9ZTIowQDaQxQKgGpB4/EJv77yRetJJZv6/U/zMq Lkj/UMLjIerpiDIZnDiAUXs1MpLklG0JkHNCJaz78WF6tAV6XF83uKj9VhzsPX5Fruv5 UGlNvKEWXZKTtBIcl8Pm1zoNnsf8l+B3+sWftb265eIdykNwQVE7Vhphc+1Ys5vdT71+ gaEg== X-Gm-Message-State: AKS2vOzag1NSdDATq7Q+4xroz4iE8wzhsDuJbxsP9OGYxgNrTQF3jTKe DvjAFNcbhlIFVw== X-Received: by 10.101.89.2 with SMTP id f2mr30610259pgu.237.1497949599536; Tue, 20 Jun 2017 02:06:39 -0700 (PDT) Received: from linux-l9pv.suse ([45.122.156.254]) by smtp.gmail.com with ESMTPSA id v62sm23392937pfb.124.2017.06.20.02.06.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:06:38 -0700 (PDT) From: "Lee, Chun-Yi" X-Google-Original-From: "Lee, Chun-Yi" To: Darren Hart Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Lee, Chun-Yi" , Andy Shevchenko , =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH] acer-wmi: Using zero as the first WMI instance number Date: Tue, 20 Jun 2017 17:06:23 +0800 Message-Id: <20170620090623.18364-1-jlee@suse.com> X-Mailer: git-send-email 2.12.0 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 Pali Rohár found that there have some wmi query/evaluation code that they used 'one' as the first WMI instance number. But the number is indexed from zero that it's must less than the instance_count in _WDG. This patch changes those instance number from one to zero. Cc: Darren Hart Cc: Andy Shevchenko Cc: Pali Rohár Signed-off-by: "Lee, Chun-Yi" --- drivers/platform/x86/acer-wmi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 79fa5ab..ef420b6 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -700,7 +700,7 @@ struct acpi_buffer *result) input.length = sizeof(struct wmab_args); input.pointer = (u8 *)regbuf; - status = wmi_evaluate_method(AMW0_GUID1, 1, 1, &input, result); + status = wmi_evaluate_method(AMW0_GUID1, 0, 1, &input, result); return status; } @@ -965,7 +965,7 @@ WMI_execute_u32(u32 method_id, u32 in, u32 *out) u32 tmp = 0; acpi_status status; - status = wmi_evaluate_method(WMID_GUID1, 1, method_id, &input, &result); + status = wmi_evaluate_method(WMID_GUID1, 0, method_id, &input, &result); if (ACPI_FAILURE(status)) return status; @@ -1275,7 +1275,7 @@ static acpi_status __init WMID_set_capabilities(void) acpi_status status; u32 devices; - status = wmi_query_block(WMID_GUID2, 1, &out); + status = wmi_query_block(WMID_GUID2, 0, &out); if (ACPI_FAILURE(status)) return status; @@ -2018,7 +2018,7 @@ static u32 get_wmid_devices(void) acpi_status status; u32 devices = 0; - status = wmi_query_block(WMID_GUID2, 1, &out); + status = wmi_query_block(WMID_GUID2, 0, &out); if (ACPI_FAILURE(status)) return 0;