From patchwork Fri Mar 27 13:55:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 46408 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 BBA8D21597 for ; Fri, 27 Mar 2015 13:56:24 +0000 (UTC) Received: by wibfv9 with SMTP id fv9sf4879823wib.1 for ; Fri, 27 Mar 2015 06:56:24 -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=wDQs8ugU7TqyEePpm0fnA6Frw4+MYdKPOe/FjWxQc64=; b=hGJuuohjy2S2ilVKds+FsIRNkuGsJGrxQwVDMecDyKP/Fj2koq+8pSLFaOuVAFCYXY NG2OU8WMhngb2UG2wI1q0h6BMQAldLdIxBF6YXYC0y/VMxQrBoN7LJ29qLMzYnfcr0Q9 2HrKXidtpVm9KUjgWtMVZRC++r4y4ZDXU3BSdw5z3PPlzlGQe2IAJpeWCii+LTeKv+2N vnkYegnLdUsmakzx9/2VU6PHNH0/giNUsN2w551pJn5wkfatwqU0+QzKozYZyYrLRGFj cG4KRcopUjCgt1nDQuKou2M4atXQgEm2QHMnzgBAKxCaiDM7CeErs+O3QvwF8QYPJg7j nHxw== X-Gm-Message-State: ALoCoQkggz1csKCAOJm4DNNiAU0PXup/PyrzvBaDrroCAvJGLc4wK6ZiMvxy/vm2JoPXEcatSk/I X-Received: by 10.194.221.65 with SMTP id qc1mr4691287wjc.7.1427464584104; Fri, 27 Mar 2015 06:56:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.101 with SMTP id z5ls396256laz.12.gmail; Fri, 27 Mar 2015 06:56:23 -0700 (PDT) X-Received: by 10.112.12.4 with SMTP id u4mr17892624lbb.4.1427464583876; Fri, 27 Mar 2015 06:56:23 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id di8si1456439lac.62.2015.03.27.06.56.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 06:56:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbcmq2 with SMTP id mq2so64140569lbc.0 for ; Fri, 27 Mar 2015 06:56:23 -0700 (PDT) X-Received: by 10.152.5.72 with SMTP id q8mr623467laq.73.1427464583778; Fri, 27 Mar 2015 06:56:23 -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 k9csp1275889lbq; Fri, 27 Mar 2015 06:56:22 -0700 (PDT) X-Received: by 10.67.7.195 with SMTP id de3mr35274887pad.79.1427464570963; Fri, 27 Mar 2015 06:56:10 -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.10; Fri, 27 Mar 2015 06:56:10 -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 S964783AbbC0N4H (ORCPT + 27 others); Fri, 27 Mar 2015 09:56:07 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35710 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932149AbbC0N4E (ORCPT ); Fri, 27 Mar 2015 09:56:04 -0400 Received: by pacwz10 with SMTP id wz10so45453412pac.2 for ; Fri, 27 Mar 2015 06:56:04 -0700 (PDT) X-Received: by 10.67.1.164 with SMTP id bh4mr34802504pad.129.1427464564014; Fri, 27 Mar 2015 06:56:04 -0700 (PDT) Received: from localhost ([104.207.83.1]) by mx.google.com with ESMTPSA id fz1sm2309196pbb.12.2015.03.27.06.56.02 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Mar 2015 06:56:03 -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 2/2] ARM64 / ACPI: make acpi_map_gic_cpu_interface() as void function Date: Fri, 27 Mar 2015 21:55:08 +0800 Message-Id: <1427464513-14414-5-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.217.171 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: , Since the only caller of acpi_parse_gic_cpu_interface() doesn't need the return value, make it have a void return type to avoid introducing subtle bugs, and update the comments of the function accordingly. Signed-off-by: Hanjun Guo --- arch/arm64/kernel/acpi.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index c263cba..8b83955 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -98,12 +98,8 @@ void __init __acpi_unmap_table(char *map, unsigned long size) /** * acpi_map_gic_cpu_interface - generates a logical cpu number * and map to MPIDR represented by GICC structure - * @mpidr: CPU's hardware id to register, MPIDR represented in MADT - * @enabled: this cpu is enabled or not - * - * Returns the logical cpu number which maps to MPIDR */ -static int __init +static void __init acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor) { int i; @@ -112,17 +108,17 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor) if (mpidr == INVALID_HWID) { pr_info("Skip MADT cpu entry with invalid MPIDR\n"); - return -EINVAL; + return; } total_cpus++; if (!enabled) - return -EINVAL; + return; if (enabled_cpus >= NR_CPUS) { pr_warn("NR_CPUS limit of %d reached, Processor %d/0x%llx ignored.\n", NR_CPUS, total_cpus, mpidr); - return -EINVAL; + return; } /* Check if GICC structure of boot CPU is available in the MADT */ @@ -130,7 +126,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor) if (bootcpu_valid) { pr_err("Firmware bug, duplicate CPU MPIDR: 0x%llx in MADT\n", mpidr); - return -EINVAL; + return; } bootcpu_valid = true; @@ -145,28 +141,27 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor) if (cpu_logical_map(i) == mpidr) { pr_err("Firmware bug, duplicate CPU MPIDR: 0x%llx in MADT\n", mpidr); - return -EINVAL; + return; } } if (!acpi_psci_present()) - return -EOPNOTSUPP; + return; cpu_ops[enabled_cpus] = cpu_get_ops("psci"); /* CPU 0 was already initialized */ if (enabled_cpus) { if (!cpu_ops[enabled_cpus]) - return -EINVAL; + return; if (cpu_ops[enabled_cpus]->cpu_init(NULL, enabled_cpus)) - return -EOPNOTSUPP; + return; /* map the logical cpu id to cpu MPIDR */ cpu_logical_map(enabled_cpus) = mpidr; } enabled_cpus++; - return enabled_cpus; } static int __init