From patchwork Thu Oct 23 02:12:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 5137721 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CF2A39F349 for ; Thu, 23 Oct 2014 02:13:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2039C20222 for ; Thu, 23 Oct 2014 02:13:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A2802021A for ; Thu, 23 Oct 2014 02:13:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932823AbaJWCNI (ORCPT ); Wed, 22 Oct 2014 22:13:08 -0400 Received: from mga09.intel.com ([134.134.136.24]:38919 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932814AbaJWCNG (ORCPT ); Wed, 22 Oct 2014 22:13:06 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 22 Oct 2014 19:11:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,773,1406617200"; d="scan'208";a="623683988" Received: from lvzheng-z530.sh.intel.com ([10.239.37.17]) by orsmga002.jf.intel.com with ESMTP; 22 Oct 2014 19:12:33 -0700 From: Lv Zheng To: "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , , linux-acpi@vger.kernel.org Subject: [PATCH 5/6] ACPI/OSL: Cleanup branch logics. Date: Thu, 23 Oct 2014 10:12:28 +0800 Message-Id: <8755bcd69676dd1ac4734db27b89fe0d13732864.1414029477.git.lv.zheng@intel.com> 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 cleans up trivial branch logics in acpi_os_unmap_iomem() to eliminate several lines. No functional changes. Signed-off-by: Lv Zheng Tested-by: Fei Yang --- drivers/acpi/mem.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/mem.c b/drivers/acpi/mem.c index c472237..c7c35f7 100644 --- a/drivers/acpi/mem.c +++ b/drivers/acpi/mem.c @@ -194,12 +194,10 @@ void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size) mutex_lock(&acpi_ioremap_lock); map = acpi_map_lookup_virt(virt, size); - if (!map) { - mutex_unlock(&acpi_ioremap_lock); + if (map) + acpi_map_put(map); + else WARN(true, PREFIX "%s: bad address %p\n", __func__, virt); - return; - } - acpi_map_put(map); mutex_unlock(&acpi_ioremap_lock); acpi_map_cleanup(map);