From patchwork Tue May 5 02:46:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 6333551 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D9137BEEE1 for ; Tue, 5 May 2015 02:47:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CC9F202F8 for ; Tue, 5 May 2015 02:47:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D5592028D for ; Tue, 5 May 2015 02:47:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965404AbbEECrh (ORCPT ); Mon, 4 May 2015 22:47:37 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:36702 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965395AbbEECrc (ORCPT ); Mon, 4 May 2015 22:47:32 -0400 Received: by pabsx10 with SMTP id sx10so177867556pab.3 for ; Mon, 04 May 2015 19:47:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kUQjk8wRnzF2M5RQhpvrBqrdLzIAASpxvPB/Lbsrmlc=; b=YurUIH1kFH3LVeE3fFv6yYFuSkTW/vmhaqiIrJV2ay+wCINDDCN68PBa1NwzC4umN0 qaCUix++rWZ/jPp5rXDH+4r2P0o0gk3OXHFPQy4pmIDqBb4LMNR4Xjy52gd7tmPiwIcH 4CM+nLf28/gjc4wpJVfner7w2FUEOmc7YO82NK/azTyD8AhI/siP1Zc0orYmyvXj4elB 0DAMCRRJ9YqJMINXT6DatoxkISXXiNrPZC0sUpdqFOsNeDlI+i93O6RAxdHLvPnsZ2v4 /2vouO6vcvGYs49QJehyta4kDngnB2BvvXYfMWvHPE5S01ilv8nhwbh8w5rjZMFW2sIR cCAA== X-Gm-Message-State: ALoCoQnKcZvvYyPUB8SbUR7wzdaoEQNNDTRINofNqlphmlLCF/ywHEmC0AvaBOBP7WomdIXYNTr8 X-Received: by 10.68.232.164 with SMTP id tp4mr17166483pbc.101.1430794052238; Mon, 04 May 2015 19:47:32 -0700 (PDT) Received: from localhost ([180.150.157.4]) by mx.google.com with ESMTPSA id gl2sm14084336pbc.52.2015.05.04.19.47.30 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 May 2015 19:47:31 -0700 (PDT) From: Hanjun Guo To: "Rafael J. Wysocki" Cc: Will Deacon , Catalin Marinas , Boris Ostrovsky , Stefano Stabellini , Lorenzo Pieralisi , Sudeep Holla , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Hanjun Guo Subject: [PATCH v2 1/7] ACPI / processor: remove cpu_index in acpi_processor_get_info() Date: Tue, 5 May 2015 10:46:32 +0800 Message-Id: <1430793998-21631-2-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430793998-21631-1-git-send-email-hanjun.guo@linaro.org> References: <1430793998-21631-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Just use pr->id instead of cpu_index to simplify the code. Signed-off-by: Hanjun Guo --- drivers/acpi/acpi_processor.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 58f335c..d6ac918 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -216,7 +216,7 @@ static int acpi_processor_get_info(struct acpi_device *device) struct acpi_buffer buffer = { sizeof(union acpi_object), &object }; struct acpi_processor *pr = acpi_driver_data(device); phys_cpuid_t phys_id; - int cpu_index, device_declaration = 0; + int device_declaration = 0; acpi_status status = AE_OK; static int cpu0_initialized; unsigned long long value; @@ -268,17 +268,16 @@ static int acpi_processor_get_info(struct acpi_device *device) acpi_handle_debug(pr->handle, "failed to get CPU physical ID.\n"); pr->phys_id = phys_id; - cpu_index = acpi_map_cpuid(pr->phys_id, pr->acpi_id); + pr->id = acpi_map_cpuid(pr->phys_id, pr->acpi_id); if (!cpu0_initialized && !acpi_has_cpu_in_madt()) { cpu0_initialized = 1; /* * Handle UP system running SMP kernel, with no CPU * entry in MADT */ - if ((cpu_index == -1) && (num_online_cpus() == 1)) - cpu_index = 0; + if ((pr->id == -1) && (num_online_cpus() == 1)) + pr->id = 0; } - pr->id = cpu_index; /* * Extra Processor objects may be enumerated on MP systems with