From patchwork Mon May 11 04:17:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 48199 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9C6AC21550 for ; Mon, 11 May 2015 04:19:33 +0000 (UTC) Received: by wgbbd3 with SMTP id bd3sf2849413wgb.2 for ; Sun, 10 May 2015 21:19: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:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=8PwYzjBoeuAj8Ix0Jp3SnnmhJwwtrIXCJtXe+JKvs1U=; b=O3jG1CigoUUJz31fMqaohQI5M2yNV+5qZjLbNlrcFoLvTM5ncSxnosXe6uXRKT8SI+ OW8PPAfmoVDgfZylGQ1d85ae9AXarBuFpNxzxGykmcW/U7ZK1aMhUkM37KYIlLLXtRs7 jACQG20RzGw38I1W7PbTQw0VtCEkM8nQHkaCFvI4CQIMExhQbllBoRDidohEvL0lgJHg 5nUyTz0qPQia0LTl4LzH2Closfh19rafkiunGRU8hKIGiMP5n11tW+kvaMUFslFHSoTC VirZEFQaCh4s9eH/wcid7SrtnJcQlqRNKtDryYRhs80L8K6gjK9NTJZ08GwTTs3rFC7S khyw== X-Gm-Message-State: ALoCoQmvJHJ8D0TSYV3FXJY71W9Cv3iLmr2pgcEEce9oD8unRaDSd+uydaI8vMuFAg0keGS01raw X-Received: by 10.112.200.166 with SMTP id jt6mr6367856lbc.17.1431317972061; Sun, 10 May 2015 21:19:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.72 with SMTP id b8ls609300laf.81.gmail; Sun, 10 May 2015 21:19:31 -0700 (PDT) X-Received: by 10.153.7.104 with SMTP id db8mr6764406lad.124.1431317971921; Sun, 10 May 2015 21:19:31 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id qa2si7639156lbb.153.2015.05.10.21.19.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 May 2015 21:19:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbqq2 with SMTP id qq2so85522037lbb.3 for ; Sun, 10 May 2015 21:19:31 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr6522706lbc.41.1431317971656; Sun, 10 May 2015 21:19:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1290608lbb; Sun, 10 May 2015 21:19:30 -0700 (PDT) X-Received: by 10.66.185.168 with SMTP id fd8mr15897376pac.27.1431317969778; Sun, 10 May 2015 21:19:29 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2si5698561pdb.51.2015.05.10.21.19.28; Sun, 10 May 2015 21:19:29 -0700 (PDT) Received-SPF: none (google.com: linux-acpi-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752558AbbEKET1 (ORCPT + 7 others); Mon, 11 May 2015 00:19:27 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:36573 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752264AbbEKESW (ORCPT ); Mon, 11 May 2015 00:18:22 -0400 Received: by pdea3 with SMTP id a3so138048167pde.3 for ; Sun, 10 May 2015 21:18:20 -0700 (PDT) X-Received: by 10.70.47.138 with SMTP id d10mr15736172pdn.137.1431317900831; Sun, 10 May 2015 21:18:20 -0700 (PDT) Received: from localhost ([180.150.153.56]) by mx.google.com with ESMTPSA id qy2sm11541562pab.5.2015.05.10.21.18.19 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 10 May 2015 21:18:20 -0700 (PDT) From: Hanjun Guo To: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Cc: Will Deacon , Catalin Marinas , Boris Ostrovsky , Stefano Stabellini , Lorenzo Pieralisi , Sudeep Holla , Konrad Rzeszutek Wilk , linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Hanjun Guo Subject: [PATCH v3 4/7] ACPI / processor: remove cpu_index in acpi_processor_get_info() Date: Mon, 11 May 2015 12:17:16 +0800 Message-Id: <1431317839-4584-5-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431317839-4584-1-git-send-email-hanjun.guo@linaro.org> References: <1431317839-4584-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Just use pr->id instead of cpu_index to simplify the code. Signed-off-by: Hanjun Guo --- drivers/acpi/acpi_processor.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index ac6bda0..0676b50 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,18 +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 (invalid_logical_cpuid(cpu_index) - && (num_online_cpus() == 1)) - cpu_index = 0; + if (invalid_logical_cpuid(pr->id) && (num_online_cpus() == 1)) + pr->id = 0; } - pr->id = cpu_index; /* * Extra Processor objects may be enumerated on MP systems with