From patchwork Wed Jan 29 18:19:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 3553671 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 175E8C02DC for ; Wed, 29 Jan 2014 18:21:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 540102018B for ; Wed, 29 Jan 2014 18:21:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 844852018A for ; Wed, 29 Jan 2014 18:21:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752708AbaA2STY (ORCPT ); Wed, 29 Jan 2014 13:19:24 -0500 Received: from mail-ig0-f170.google.com ([209.85.213.170]:44237 "EHLO mail-ig0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753368AbaA2STV (ORCPT ); Wed, 29 Jan 2014 13:19:21 -0500 Received: by mail-ig0-f170.google.com with SMTP id m12so17925528iga.1 for ; Wed, 29 Jan 2014 10:19:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=kfEUube1A83dO3BvewI9ab/UJhcveWsEKXqP9UfMfJ4=; b=bpUY5utbhII5bHWLUIoLTZKN0mBNe2vr7tT3FA3s/+nUzNDn7b1m1iezo6RJvbqTKc hstlQH9OLi44kH3TDLRfa1j5LK7cXAMY7LTa8hp7MWCefJx20pk7g4JehjWCRkalxoZM ImV9Z/CgMKKo3GE/35tJgNp2qOiamWj7PlIJw4jatWvFXWbmt/1NuWYTz1aM2f/xoTgC po5NSKAtEHRNQlRm7T2HBD1LUc4JO/P3g1RCdhWkEQGS4nNMj8gtOYqzStHR58QZlibf ZSqsGD0Lw2OVt/J73I/8Pm9TybEjKz0j9ppxm7rhXKXQvxDjH/dM5YTCMpZc7IsKK+es q2tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=kfEUube1A83dO3BvewI9ab/UJhcveWsEKXqP9UfMfJ4=; b=Qzd8ndZZOppFFWDCUeafdC+ITTZ4h8Y0XsUnQ5AKkZ49ttHr7OR+J9hu0ED/9cGs+g 9j7K3Huw3ZZvj/DfDd5sXtYwPIGV3VS6EtnVd9/6LKHBTzLHBWh4oOrl7RLqJTvK+RyR XOeVdSzAI41X7KRPdNaLFuysEHs1dNZtU6elHljRef8qpizV6vd7g47ClFyOy/CNxu+b VHukn4fnXONcLVJPhGR5NY7iENE/c2p/FZR/VktLW/bUIoSdokSTPaIzQ0IxZfMIE9QQ ZYpJM57WiwMCJrnxoJk7l1n5hqsouP0CsTRwiWORFEqDO2rMXjO/f6mdeXsNgCc+wWmw YxGg== X-Gm-Message-State: ALoCoQlSjuEF/T6o9/3v/0GQjXrf0AtweSSOMSXGSJwmQgWGN+zaBDub0q9rMHhet6HhAVJ9nwnPczqkPf5r88acmv5kad96pebfPaM4QP+h5ZPsSpwvFTHv7DeX2we/9RID7hawzoUPs381FzrnFLw1ir16vnXV0CHpoB/VRP+/1uD/qjrwIBmYaENuzQ2/TdWbqa7+ekZtyhvk6L91E3ZGQozDQ8/ZZIt5wQqgf1wUFq5Zl2uoHzE= X-Received: by 10.50.138.72 with SMTP id qo8mr9969302igb.8.1391019560809; Wed, 29 Jan 2014 10:19:20 -0800 (PST) Received: from localhost ([172.29.123.160]) by mx.google.com with ESMTPSA id kb10sm11175091igb.6.2014.01.29.10.19.19 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 29 Jan 2014 10:19:20 -0800 (PST) Subject: [PATCH 15/17] ACPI / numa: Simplify acpi_get_node() style To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org, x86@kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 29 Jan 2014 11:19:18 -0700 Message-ID: <20140129181918.15476.38407.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140129174106.15476.7075.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140129174106.15476.7075.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Simplify control flow by removing local variable initialization and returning a constant as soon as possible. No functional change. Signed-off-by: Bjorn Helgaas --- drivers/acpi/numa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index dab7dac6b1a8..a7e779bfa2f6 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -333,12 +333,12 @@ int acpi_get_pxm(acpi_handle h) int acpi_get_node(acpi_handle handle) { - int pxm, node = NUMA_NO_NODE; + int pxm; pxm = acpi_get_pxm(handle); - if (pxm >= 0 && pxm < MAX_PXM_DOMAINS) - node = acpi_map_pxm_to_node(pxm); + if (pxm < 0 || pxm >= MAX_PXM_DOMAINS) + return NUMA_NO_NODE; - return node; + return acpi_map_pxm_to_node(pxm); } EXPORT_SYMBOL(acpi_get_node);