From patchwork Fri Mar 27 14:02:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 46420 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C67FC21597 for ; Fri, 27 Mar 2015 14:03:59 +0000 (UTC) Received: by wgfh4 with SMTP id h4sf11167960wgf.1 for ; Fri, 27 Mar 2015 07:03:59 -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=MTCIskQlwOSzLlBaEbIuZ/uZbA1t6q4t563fe9y3io571v9nl9MCpcUmOw1I9sdUwb osihLBbirVALndM2W/FipB3KUOe+31a23b/DsCFjvxx6gR+6UflCzkjg4YDQyjeyhnfj ZUtEoaCKZpPbpKw4z5czYq6f/tPPgR2iFAZBX+Nq9Q7nj2BatP10Cb320Guk1hHoUlii nPoWZgZgpqNUlUPho/6sy0y6iG7IPGIu8MbLciY4gBJKycKpXTauF0IFu8FDqrNhzB6s IFh07s5U/eDvgUqGpUwev/5rs/KEjc2SiRx+o6iZ2p+NV7pPkE3IB6f/ByEZfma2StFi t2YA== X-Gm-Message-State: ALoCoQlHT+9MnipHKWP2YtPR0+F8J+KZiPvfIDQAQuJxVmSMEPyW7NbELMvGt901ew7O4z1BT6P3 X-Received: by 10.112.125.67 with SMTP id mo3mr4636663lbb.6.1427465039093; Fri, 27 Mar 2015 07:03:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.232 with SMTP id u8ls385955laa.24.gmail; Fri, 27 Mar 2015 07:03:58 -0700 (PDT) X-Received: by 10.112.9.236 with SMTP id d12mr18481167lbb.102.1427465038721; Fri, 27 Mar 2015 07:03:58 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id 6si1473783lal.25.2015.03.27.07.03.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 07:03:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbug6 with SMTP id ug6so64279281lbb.3 for ; Fri, 27 Mar 2015 07:03:58 -0700 (PDT) X-Received: by 10.112.141.202 with SMTP id rq10mr18011144lbb.88.1427465038480; Fri, 27 Mar 2015 07:03:58 -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 k9csp1280537lbq; Fri, 27 Mar 2015 07:03:57 -0700 (PDT) X-Received: by 10.70.88.137 with SMTP id bg9mr36187414pdb.92.1427465036669; Fri, 27 Mar 2015 07:03:56 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fj8si2997794pad.135.2015.03.27.07.03.55; Fri, 27 Mar 2015 07:03:56 -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 S1752878AbbC0ODq (ORCPT + 27 others); Fri, 27 Mar 2015 10:03:46 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:33370 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752611AbbC0ODl (ORCPT ); Fri, 27 Mar 2015 10:03:41 -0400 Received: by pdnc3 with SMTP id c3so97654041pdn.0 for ; Fri, 27 Mar 2015 07:03:41 -0700 (PDT) X-Received: by 10.66.154.162 with SMTP id vp2mr35197842pab.73.1427465020909; Fri, 27 Mar 2015 07:03:40 -0700 (PDT) Received: from localhost ([104.207.83.1]) by mx.google.com with ESMTPSA id cd3sm2319843pad.38.2015.03.27.07.03.39 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Mar 2015 07:03:40 -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 22:02:22 +0800 Message-Id: <1427464948-14564-2-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427464948-14564-1-git-send-email-hanjun.guo@linaro.org> References: <1427464948-14564-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.217.176 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