From patchwork Tue May 5 02:46:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 48015 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 E725D2121F for ; Tue, 5 May 2015 02:49:20 +0000 (UTC) Received: by wixv7 with SMTP id v7sf39116803wix.0 for ; Mon, 04 May 2015 19:49:20 -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=77mrXHRKikvU/HgpURNYeAkfwEeUdWxLk2gaW+35H7c=; b=gb2PfL/mAHRXKhPfurYLhpZulcBuZ5ZW1XOPydM4LX3OvPJoq25TFWlEBNnZEBKlvR J81u/eVmHLN4nmoVeQooQbNrm3dO+/TLaRtUHb8j0n6xohZFx5EnC9lTu5N/o/Lx7dzK xWfX/18psbBjnCpDW4SSOCvGGyXW6Y8EPcyYMnW7vb2Vvnw94f0dIphqvGPR1pX5UWt7 vrb9XLZZ6WJAPdXSFCbFZlEjKSYJW60KxhDpLZ0iNPP/dFjEU7OwAhqPBDN+zg+0/mYA jRtjiu9EGi+jZ6j1Mi4IYsyK302Ppz3vhlZyU0BKGP98Q+7KqVrbL+IBNGHF+UsnILrf UbpQ== X-Gm-Message-State: ALoCoQkkEjH34pfuPDt0pHMItyPVCW5n5OJUE/UndKtMk1R9kikAmXTwshR0nhibiSK/D34KgowZ X-Received: by 10.112.29.39 with SMTP id g7mr20583106lbh.1.1430794160241; Mon, 04 May 2015 19:49:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.35 with SMTP id cr3ls700513lad.47.gmail; Mon, 04 May 2015 19:49:20 -0700 (PDT) X-Received: by 10.152.7.97 with SMTP id i1mr21340335laa.49.1430794160002; Mon, 04 May 2015 19:49:20 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id pz9si11293237lbb.92.2015.05.04.19.49.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 19:49:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by laat2 with SMTP id t2so117409742laa.1 for ; Mon, 04 May 2015 19:49:19 -0700 (PDT) X-Received: by 10.152.9.66 with SMTP id x2mr21891066laa.36.1430794159721; Mon, 04 May 2015 19:49:19 -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 l1csp1987699lbt; Mon, 4 May 2015 19:49:18 -0700 (PDT) X-Received: by 10.66.139.234 with SMTP id rb10mr41767717pab.153.1430794157928; Mon, 04 May 2015 19:49:17 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si22186159pdm.207.2015.05.04.19.49.17; Mon, 04 May 2015 19:49:17 -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 S1755072AbbEECtB (ORCPT + 7 others); Mon, 4 May 2015 22:49:01 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35910 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965423AbbEECrr (ORCPT ); Mon, 4 May 2015 22:47:47 -0400 Received: by pabsx10 with SMTP id sx10so177872220pab.3 for ; Mon, 04 May 2015 19:47:46 -0700 (PDT) X-Received: by 10.70.126.225 with SMTP id nb1mr47922895pdb.71.1430794066258; Mon, 04 May 2015 19:47:46 -0700 (PDT) Received: from localhost ([180.150.157.4]) by mx.google.com with ESMTPSA id f4sm14146111pdc.95.2015.05.04.19.47.45 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 May 2015 19:47:45 -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 4/7] Xen / ACPI / processor: use invalid_logical_cpuid() Date: Tue, 5 May 2015 10:46:35 +0800 Message-Id: <1430793998-21631-5-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.51 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: , Use invalid_logical_cpuid(pr->id) instead of direct comparison of -1. Signed-off-by: Hanjun Guo CC: Boris Ostrovsky CC: Stefano Stabellini --- drivers/xen/xen-acpi-cpuhotplug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/xen/xen-acpi-cpuhotplug.c b/drivers/xen/xen-acpi-cpuhotplug.c index 3e62ee4..5a62aa0 100644 --- a/drivers/xen/xen-acpi-cpuhotplug.c +++ b/drivers/xen/xen-acpi-cpuhotplug.c @@ -77,7 +77,7 @@ static int xen_acpi_processor_enable(struct acpi_device *device) pr->id = xen_pcpu_id(pr->acpi_id); - if ((int)pr->id < 0) + if (invalid_logical_cpuid(pr->id)) /* This cpu is not presented at hypervisor, try to hotadd it */ if (ACPI_FAILURE(xen_acpi_cpu_hotadd(pr))) { pr_err(PREFIX "Hotadd CPU (acpi_id = %d) failed.\n", @@ -226,7 +226,7 @@ static acpi_status xen_acpi_cpu_hotadd(struct acpi_processor *pr) return AE_ERROR; pr->id = xen_hotadd_cpu(pr); - if ((int)pr->id < 0) + if (invalid_logical_cpuid(pr->id)) return AE_ERROR; /*