From patchwork Fri Mar 27 13:55:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 46411 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3858021597 for ; Fri, 27 Mar 2015 13:56:41 +0000 (UTC) Received: by lbbzl9 with SMTP id zl9sf10901747lbb.2 for ; Fri, 27 Mar 2015 06:56:40 -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=C1lCirJhLWl/bXb7YVeQ3lIFa+fhcafH2xrCXYmx9ejbpA/Q1HFMiwgS7hDz9IDsPm RglE38OL6sSjPY5cwfj+ZhXUWlckhbl+cSLTBHJZHqmg7kUhCt08AwKmFOqzLOX0zXBK 9S0nNBrEM9pCQ2KW+I89KZXNnx3CJeMfxki7nsSmAQ6DUHmVaB4hbXBWjRQX0Etg9cS3 Mr3LG3B9ijglVjzLdPQxggGNlIyIdFdVc67KJhP8Dt9MbVqhdzTukRZ1zap0e42qgMf2 ThRHOKKrXIxa64F52om5yZLMwAODsPCyMh7GRCrm3TxiO0mdEzk4FjEwWZKm2fJb91sd eCvg== X-Gm-Message-State: ALoCoQkQyNwfGs+3qKIlxaOxh0l0UYtJ7m+n/w23tliP7oPx3C2H1lV8AAXI3XEH9m8JKnf7I4mW X-Received: by 10.180.101.39 with SMTP id fd7mr6913529wib.0.1427464600188; Fri, 27 Mar 2015 06:56:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.50 with SMTP id bd18ls412907lab.108.gmail; Fri, 27 Mar 2015 06:56:40 -0700 (PDT) X-Received: by 10.152.22.67 with SMTP id b3mr17578221laf.117.1427464599978; Fri, 27 Mar 2015 06:56:39 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id ci9si1445653lbd.138.2015.03.27.06.56.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 06:56:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbcmq2 with SMTP id mq2so64146686lbc.0 for ; Fri, 27 Mar 2015 06:56:39 -0700 (PDT) X-Received: by 10.112.8.101 with SMTP id q5mr18019462lba.19.1427464599887; Fri, 27 Mar 2015 06:56:39 -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 k9csp1276034lbq; Fri, 27 Mar 2015 06:56:39 -0700 (PDT) X-Received: by 10.70.63.38 with SMTP id d6mr4435870pds.50.1427464592925; Fri, 27 Mar 2015 06:56:32 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dn1si2940342pbb.242.2015.03.27.06.56.32; Fri, 27 Mar 2015 06:56:32 -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 S964841AbbC0N43 (ORCPT + 27 others); Fri, 27 Mar 2015 09:56:29 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:36100 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964801AbbC0N4X (ORCPT ); Fri, 27 Mar 2015 09:56:23 -0400 Received: by padcy3 with SMTP id cy3so96482981pad.3 for ; Fri, 27 Mar 2015 06:56:22 -0700 (PDT) X-Received: by 10.66.118.198 with SMTP id ko6mr36278869pab.16.1427464582469; Fri, 27 Mar 2015 06:56:22 -0700 (PDT) Received: from localhost ([104.207.83.1]) by mx.google.com with ESMTPSA id ca17sm2292173pdb.95.2015.03.27.06.56.21 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Mar 2015 06:56:21 -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 21:55:12 +0800 Message-Id: <1427464513-14414-9-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.170 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)