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: 48009 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3F2A82121F for ; Tue, 5 May 2015 02:47:48 +0000 (UTC) Received: by wixv7 with SMTP id v7sf39112157wix.0 for ; Mon, 04 May 2015 19:47:47 -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=HLgtVEC3euLHVgRuEn2PaUbUlCZOQEXgkAoD3DS5/Ic=; b=RtdVbqI3spJtMINAGwUvxE29v7LWv+Jjxui3ihfippAnHV9ZzrE/4fjFE/r8eHzX4U /F3RR3OyJ3TUPhklk7gn3blYRwM20+oULvSw+racfzxeh+BE/VOlOTTZ2FKcMjenXhpA J4x8Q2idtT81BFUDHwCSQELbvPh7o5hidG+X4xaZ8sMgT/xFaOjBOCa+9mdrR03jBV// sYeb/orc4+64WGFUeVlnC2sV5aGbmY0m4Okb2voYc9nvVfIiikGt5fqOSqPGvVTFNTne FAhqgFGMH5GC4byM9psCPLxxx8n/b/vMjwtHBfD692q1nrWBPdluaooh91ZZ/KIy/ZnP CCZg== X-Gm-Message-State: ALoCoQlB0p2+diyp5ZUjhiGbSBnn2+2l5MicwkRJRHu9RGzOLxfkBSt8X9O7EnTl5rO8rYmgHnJe X-Received: by 10.112.189.131 with SMTP id gi3mr20594264lbc.6.1430794067540; Mon, 04 May 2015 19:47:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.73 with SMTP id lm9ls926405lac.20.gmail; Mon, 04 May 2015 19:47:47 -0700 (PDT) X-Received: by 10.112.230.37 with SMTP id sv5mr3394546lbc.85.1430794067406; Mon, 04 May 2015 19:47:47 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id q1si11283572lbr.116.2015.05.04.19.47.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 19:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labbd9 with SMTP id bd9so117437352lab.2 for ; Mon, 04 May 2015 19:47:47 -0700 (PDT) X-Received: by 10.152.9.66 with SMTP id x2mr21887701laa.36.1430794067146; Mon, 04 May 2015 19:47:47 -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.67.65 with SMTP id l1csp1987286lbt; Mon, 4 May 2015 19:47:46 -0700 (PDT) X-Received: by 10.66.141.77 with SMTP id rm13mr47538778pab.14.1430794063821; Mon, 04 May 2015 19:47:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12si22104474pbu.238.2015.05.04.19.47.43; Mon, 04 May 2015 19:47:43 -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 S965404AbbEECrh (ORCPT + 7 others); 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-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: 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.215.46 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