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: 3553661 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 94DD4C02DC for ; Wed, 29 Jan 2014 18:21:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC9A52018B for ; Wed, 29 Jan 2014 18:21:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 133D02018A for ; Wed, 29 Jan 2014 18:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753368AbaA2STY (ORCPT ); Wed, 29 Jan 2014 13:19:24 -0500 Received: from mail-ie0-f178.google.com ([209.85.223.178]:39476 "EHLO mail-ie0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753367AbaA2STV (ORCPT ); Wed, 29 Jan 2014 13:19:21 -0500 Received: by mail-ie0-f178.google.com with SMTP id x13so2341791ief.23 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=QAefz52v7bxEk8NESEJBZBevvql8Pl49SG+k++vUCRX5hnQZSXBUTBqGlsU6GYqjYK i0Ag1FuHmXu0DZiGsoSl0D7yjFSPAP6/vcRybeEzPtQoywKwUqhVDe6drNafQUK0kgda ZGVTtXi+TecACVjnDFaCzBzaBSJttNfN0CMyl4MNKZvNoVSDqOT4ViJ29r4Ma4TAT19O K7exeZCjMYHwhegl/HyGjaQeBA//9XmTMl6c3vLPYeKR6RNaZdI2Ck7L4Dbj4Js0HdOZ JcTr5isEoiFnr7Z7CkTEnC/gY7tKpopYo6pfmIUG/UQmEIBwHRtFNwBs3ESOitHsNTff yWfA== X-Gm-Message-State: ALoCoQmnAsoIGL2zezxV5danztjkyIggzM8BJBSgaKzqprTZ9tgwWBx5JlWbVBxICvG6v9QWhJGZlj0JvA1v4FawaNNCB84GzXWM79vdN8e5PhEOzGVznagnW/ceUd65+MveB8UtJzrobRVGVGyW1V0LJPUsidLGG7TMtUuWi8Z8Q18uXT9/iBf7419oUmsXsGfXZV+8uUAAAjBrjewMk3p2+XiR2h5sGA== 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-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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=ham 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-acpi" 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);