From patchwork Fri Mar 27 14:02:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 46425 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E2EEE21597 for ; Fri, 27 Mar 2015 14:04:43 +0000 (UTC) Received: by lajy8 with SMTP id y8sf667346laj.3 for ; Fri, 27 Mar 2015 07:04:42 -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=al5pUS2Vg3BPGhNkmwLzN+HgRjC9x/6MN8iitNgvftc=; b=Qq2uXzHg2tjxZlU5LyvLJ4yDJDaakaUdugCCR+b2IHTxOq5GDZPv1LYWfpPXUKUyEd 6cwnfrO0zHNSev6Tk4/LrloMfL1ZB2G6MlEYzf12V3qv2Bpj6rGwUAve9qJx50mwPlkM aq/dnfCW3HCahM4jXjGl0+OQ/GQxYGjDqHRZJJNEMZNGNoz1FM8BBN5tRsW+qun7FagU JL+DFSKCIzcA3sJlNXFANZliDwUDl8eqOvdWAN8it1arxwVFaMxRkkIL5gTjJNJE3z4O /SfZcS4LEnzNnX7vGgD3Jnr+Lx73dfSc6pJVJvHZhfx3edzbiqNnsazKS/JY/sd3LFBl Vi5w== X-Gm-Message-State: ALoCoQk++Ny0gwP1za6nAqSpr/EPqAwxXXF4Za9ablTXVpu8PfflSo1UeqP62cbAPXVAxpq46CCk X-Received: by 10.180.9.228 with SMTP id d4mr659732wib.1.1427465082910; Fri, 27 Mar 2015 07:04:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.69 with SMTP id i5ls357601lah.56.gmail; Fri, 27 Mar 2015 07:04:42 -0700 (PDT) X-Received: by 10.152.43.102 with SMTP id v6mr17926531lal.1.1427465082523; Fri, 27 Mar 2015 07:04:42 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id w2si1480510lbs.15.2015.03.27.07.04.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 07:04:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by lagg8 with SMTP id g8so71146212lag.1 for ; Fri, 27 Mar 2015 07:04:42 -0700 (PDT) X-Received: by 10.152.29.68 with SMTP id i4mr18046889lah.19.1427465082431; Fri, 27 Mar 2015 07:04:42 -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 k9csp1281040lbq; Fri, 27 Mar 2015 07:04:41 -0700 (PDT) X-Received: by 10.66.142.100 with SMTP id rv4mr36315380pab.84.1427465066860; Fri, 27 Mar 2015 07:04:26 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ze3si2974986pbc.209.2015.03.27.07.04.25; Fri, 27 Mar 2015 07:04:26 -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 S932193AbbC0OEJ (ORCPT + 27 others); Fri, 27 Mar 2015 10:04:09 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:33986 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932167AbbC0OEE (ORCPT ); Fri, 27 Mar 2015 10:04:04 -0400 Received: by pdbni2 with SMTP id ni2so97529476pdb.1 for ; Fri, 27 Mar 2015 07:04:04 -0700 (PDT) X-Received: by 10.69.16.199 with SMTP id fy7mr35636774pbd.147.1427465044037; Fri, 27 Mar 2015 07:04:04 -0700 (PDT) Received: from localhost ([104.207.83.1]) by mx.google.com with ESMTPSA id o17sm2329388pdj.26.2015.03.27.07.04.02 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Mar 2015 07:04: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 6/7] ACPI / processor: return specific error instead of -1 Date: Fri, 27 Mar 2015 22:02:27 +0800 Message-Id: <1427464948-14564-7-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.215.48 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 invalid_logical_cpuid() can check error values, so return specific error instead of -1 for acpi_map_cpuid(). Signed-off-by: Hanjun Guo --- drivers/acpi/processor_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index b1ec78b..fd4140d 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -215,12 +215,12 @@ int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id) * Ignores phys_id and always returns 0 for the processor * handle with acpi id 0 if nr_cpu_ids is 1. * This should be the case if SMP tables are not found. - * Return -1 for other CPU's handle. + * Return -EINVAL for other CPU's handle. */ if (nr_cpu_ids <= 1 && acpi_id == 0) return acpi_id; else - return -1; + return -EINVAL; } #ifdef CONFIG_SMP @@ -233,7 +233,7 @@ int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id) if (phys_id == 0) return phys_id; #endif - return -1; + return -ENODEV; } int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id)