From patchwork Fri May 27 03:40:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 9137615 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 16716607D3 for ; Fri, 27 May 2016 03:40:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08BC628138 for ; Fri, 27 May 2016 03:40:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1862282E1; Fri, 27 May 2016 03:40:58 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham 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 72A2028138 for ; Fri, 27 May 2016 03:40:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932254AbcE0Dk5 (ORCPT ); Thu, 26 May 2016 23:40:57 -0400 Received: from mga14.intel.com ([192.55.52.115]:61298 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932194AbcE0Dk4 (ORCPT ); Thu, 26 May 2016 23:40:56 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 26 May 2016 20:40:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,371,1459839600"; d="scan'208";a="815808599" Received: from unknown (HELO lvzheng-z530.sh.intel.com) ([10.239.159.172]) by orsmga003.jf.intel.com with ESMTP; 26 May 2016 20:40:53 -0700 From: Lv Zheng To: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , , linux-acpi@vger.kernel.org Subject: [PATCH] ACPICA / hardware: Fix address check in acpi_hw_get_access_bit_width() Date: Fri, 27 May 2016 11:40:50 +0800 Message-Id: <1464320450-5175-1-git-send-email-lv.zheng@intel.com> X-Mailer: git-send-email 1.7.10 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The address check in acpi_hw_get_access_bit_width() should be byte size based, not bit width based. This patch fixes this mistake. Reported-by: Boris Ostrovsky Suggested-by: Jan Beulich Signed-off-by: Lv Zheng --- drivers/acpi/acpica/hwregs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c index 0f18dbc..74a591b 100644 --- a/drivers/acpi/acpica/hwregs.c +++ b/drivers/acpi/acpica/hwregs.c @@ -95,7 +95,7 @@ acpi_hw_get_access_bit_width(struct acpi_generic_address *reg, u8 max_bit_width) if (!reg->bit_offset && reg->bit_width && ACPI_IS_POWER_OF_TWO(reg->bit_width) && ACPI_IS_ALIGNED(reg->bit_width, 8) && - ACPI_IS_ALIGNED(address, reg->bit_width)) { + ACPI_IS_ALIGNED(address, reg->bit_width >> 3)) { return (reg->bit_width); } else { if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {