From patchwork Tue May 5 02:46:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 48013 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 328F02121F for ; Tue, 5 May 2015 02:49:17 +0000 (UTC) Received: by layy10 with SMTP id y10sf50850109lay.0 for ; Mon, 04 May 2015 19:49:16 -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=n8NlnkrVFYTOx+j1SUfQU53xJ1Px0j20bN4AS/m6UmI=; b=f1KI7eGr5pkR8HF1TtZVMuHq3A2jMm8HjoXnlxBEDy1z03o4LTqPCoA9a2aQwQlD1O S165qZvCxsiNM5z0yQ0fi5ZzJnByhYTVD0tRCxF/d+JVFPu26nOb6F9jMQMUecHWlLSL mAycDoiFw7LxEeYq8Ab1j7PlmWn4C+3m/20LqPUIqU7PcKkKEjaSH3Y3Qsy6Num8hzfw tA6QEyE8yboB3IrXG0RL9fFq2UwG3QkS1+P+N68w7tvgSM8EL652VHCcFHBez3dPnA1S edDKYa/Mjg/H81Yb0Kf5bAVyeeth/m5s8Vi71okYLYGaybzkmT2EiccggVVGH2QtvPON oyXg== X-Gm-Message-State: ALoCoQmXpf70YLKMBsePJfJfGTBbkRiYeA8MmOMRyG0u2hKBJaeU8sdG5t/qGmy/aXCH7x/SDUvk X-Received: by 10.112.160.197 with SMTP id xm5mr20562148lbb.15.1430794156101; Mon, 04 May 2015 19:49:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.244.162 with SMTP id xh2ls864244lac.108.gmail; Mon, 04 May 2015 19:49:15 -0700 (PDT) X-Received: by 10.152.207.41 with SMTP id lt9mr21665401lac.52.1430794155961; Mon, 04 May 2015 19:49:15 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id et1si11311429lac.11.2015.05.04.19.49.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 19:49:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbzk7 with SMTP id zk7so118309642lbb.0 for ; Mon, 04 May 2015 19:49:15 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr9592566lbc.19.1430794155838; Mon, 04 May 2015 19:49:15 -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 l1csp1987676lbt; Mon, 4 May 2015 19:49:15 -0700 (PDT) X-Received: by 10.68.97.131 with SMTP id ea3mr8163962pbb.165.1430794153979; Mon, 04 May 2015 19:49:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rb6si22253324pab.42.2015.05.04.19.49.13; Mon, 04 May 2015 19:49:13 -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 S965477AbbEECs5 (ORCPT + 7 others); Mon, 4 May 2015 22:48:57 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:35104 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965435AbbEECr5 (ORCPT ); Mon, 4 May 2015 22:47:57 -0400 Received: by pdbqd1 with SMTP id qd1so180584356pdb.2 for ; Mon, 04 May 2015 19:47:55 -0700 (PDT) X-Received: by 10.70.27.196 with SMTP id v4mr47087265pdg.122.1430794075797; Mon, 04 May 2015 19:47:55 -0700 (PDT) Received: from localhost ([180.150.157.4]) by mx.google.com with ESMTPSA id pj8sm14171486pdb.20.2015.05.04.19.47.54 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 May 2015 19:47:55 -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 6/7] ACPI / processor: return specific error instead of -1 Date: Tue, 5 May 2015 10:46:37 +0800 Message-Id: <1430793998-21631-7-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.217.172 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)