From patchwork Thu Oct 23 02:12:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 5137751 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9A09DC11AC for ; Thu, 23 Oct 2014 02:14:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE15320222 for ; Thu, 23 Oct 2014 02:14:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFD4420221 for ; Thu, 23 Oct 2014 02:14:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753253AbaJWCM2 (ORCPT ); Wed, 22 Oct 2014 22:12:28 -0400 Received: from mga11.intel.com ([192.55.52.93]:18562 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932184AbaJWCMX (ORCPT ); Wed, 22 Oct 2014 22:12:23 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 22 Oct 2014 19:12:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,773,1406617200"; d="scan'208";a="618927050" Received: from lvzheng-z530.sh.intel.com ([10.239.37.17]) by fmsmga002.fm.intel.com with ESMTP; 22 Oct 2014 19:12:20 -0700 From: Lv Zheng To: "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , , linux-acpi@vger.kernel.org Subject: [PATCH 3/6] ACPI/OSL: Cleanup memory access functions by merging duplicate code. Date: Thu, 23 Oct 2014 10:12:16 +0800 Message-Id: X-Mailer: git-send-email 1.7.10 In-Reply-To: References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch merges duplicate code to cleanup ACPI memory access implementations. No functional changes. Signed-off-by: Lv Zheng Tested-by: Fei Yang --- drivers/acpi/mem.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/mem.c b/drivers/acpi/mem.c index defd317..ba74086 100644 --- a/drivers/acpi/mem.c +++ b/drivers/acpi/mem.c @@ -260,7 +260,6 @@ EXPORT_SYMBOL(acpi_os_map_generic_address); void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) { u64 addr; - struct acpi_ioremap *map; if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) return; @@ -270,16 +269,8 @@ void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) if (!addr || !gas->bit_width) return; - mutex_lock(&acpi_ioremap_lock); - map = acpi_map_lookup_phys(addr, gas->bit_width / 8); - if (!map) { - mutex_unlock(&acpi_ioremap_lock); - return; - } - acpi_map_put(map); - mutex_unlock(&acpi_ioremap_lock); - - acpi_map_cleanup(map); + acpi_os_unmap_iomem((void __iomem *)((unsigned long)addr), + gas->bit_width / 8); } EXPORT_SYMBOL(acpi_os_unmap_generic_address);