From patchwork Fri Mar 27 13:55:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 46404 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1A49D21597 for ; Fri, 27 Mar 2015 13:56:14 +0000 (UTC) Received: by lbbug6 with SMTP id ug6sf10899117lbb.3 for ; Fri, 27 Mar 2015 06:56:12 -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=jUPoCd63SRqGmitWCFA2NJ18wZABBq2ICrMJ0wOI3Ac=; b=GkM22VxLWJ6L4EF0sEkupgPQpqSlyVE6taSP7Acu0PC6Th27kukRAxca60dKri24Zs CWQN1RZw1oDKlY36EG/4erSVSBkFtxApYsH5vt+u1+1L6y83fyr+ynK6v+6QPOlEn4JO txkpnUgkWhMtGJlbhxfWeGj30AsLoNrZngqF4OcMlr0lUNjaOnXMrRF4V0WtslisNLFA 2AJnXpcPo+8LpZJyGOMYZsrgYwcIhZ5FutCDiDZgVIvon0yf2RVUzfILFo2qS4FCJQBO igf96KNP/0faWcP0ssxbshgPyeU8+seTgWew9R7RvelE8XsAughoU+yRfuYAV89F6Sne B8rg== X-Gm-Message-State: ALoCoQm2zmNpZ+6UXC0pKb2bU5ARVi9FhKBOXHO3mQg4sAg7asol1BJwuGzvDyhIzbJbLEZJrmxy X-Received: by 10.194.95.67 with SMTP id di3mr4706888wjb.0.1427464572403; Fri, 27 Mar 2015 06:56:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.225 with SMTP id db1ls291311lac.78.gmail; Fri, 27 Mar 2015 06:56:12 -0700 (PDT) X-Received: by 10.152.2.105 with SMTP id 9mr17654821lat.16.1427464572182; Fri, 27 Mar 2015 06:56:12 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id z5si1450057lbf.103.2015.03.27.06.56.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 06:56:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagg8 with SMTP id g8so70944118lag.1 for ; Fri, 27 Mar 2015 06:56:11 -0700 (PDT) X-Received: by 10.152.29.68 with SMTP id i4mr18017893lah.19.1427464571679; Fri, 27 Mar 2015 06:56:11 -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.57.201 with SMTP id k9csp1275754lbq; Fri, 27 Mar 2015 06:56:09 -0700 (PDT) X-Received: by 10.66.241.36 with SMTP id wf4mr36281428pac.8.1427464568055; Fri, 27 Mar 2015 06:56:08 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ee5si2969559pac.139.2015.03.27.06.56.07; Fri, 27 Mar 2015 06:56:08 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S932088AbbC0Nzy (ORCPT + 27 others); Fri, 27 Mar 2015 09:55:54 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:33101 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753039AbbC0Nzu (ORCPT ); Fri, 27 Mar 2015 09:55:50 -0400 Received: by pdnc3 with SMTP id c3so97456814pdn.0 for ; Fri, 27 Mar 2015 06:55:50 -0700 (PDT) X-Received: by 10.68.237.138 with SMTP id vc10mr36154321pbc.48.1427464550019; Fri, 27 Mar 2015 06:55:50 -0700 (PDT) Received: from localhost ([104.207.83.1]) by mx.google.com with ESMTPSA id l2sm2303185pbq.30.2015.03.27.06.55.48 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Mar 2015 06:55:48 -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 1/7] ACPI / processor: remove cpu_index in acpi_processor_get_info() Date: Fri, 27 Mar 2015 21:55:05 +0800 Message-Id: <1427464513-14414-2-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427464513-14414-1-git-send-email-hanjun.guo@linaro.org> References: <1427464513-14414-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@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.215.49 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 | 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