From patchwork Fri Mar 27 14:02:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 46423 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 7855B21597 for ; Fri, 27 Mar 2015 14:04:26 +0000 (UTC) Received: by wibfv9 with SMTP id fv9sf4938935wib.1 for ; Fri, 27 Mar 2015 07:04:25 -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=LHr8hQguVG/y5mJ5Andqa1wO161BdXTsEs7epLA6xLm4mFA4MWWr/l5afKXb21afXP rvj8GE+KOr1vFsADp6tkO2La41p2obb9ZwDRu4Rg4Vv5YlR1pgUFeodE4nnzUAhLJ6iL HR8VcYyP1tbGMaPc1ozouiMVvu+Kk143I2nN/gCq0j74ov5XLo3L9YuOVQdtsDPINslr nDJvvSRKhi8FgBN3brFoA69/UFux8q/ih4xtoTOmhOTfDdEvWfFuX0UpXbERXs12ZbSm 2ap+vA+68QJaRwkUNYyMRviAIep8Hem4OfqEokqizxmEzb1P/QphaSv3A/tIh1fG4gBg +kGw== X-Gm-Message-State: ALoCoQkeyttSE9qMdB0J3AiOA2MsgO92l6b7MO5gxXBzVfW7JY59w2CdP4FG4WZit9xL0loUAOeN X-Received: by 10.152.27.134 with SMTP id t6mr4687146lag.5.1427465065731; Fri, 27 Mar 2015 07:04:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.42 with SMTP id g10ls383712laa.51.gmail; Fri, 27 Mar 2015 07:04:25 -0700 (PDT) X-Received: by 10.152.87.46 with SMTP id u14mr17874280laz.82.1427465065597; Fri, 27 Mar 2015 07:04:25 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id a2si1463506lah.96.2015.03.27.07.04.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 07:04:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labto5 with SMTP id to5so71360570lab.0 for ; Fri, 27 Mar 2015 07:04:25 -0700 (PDT) X-Received: by 10.112.160.227 with SMTP id xn3mr4170678lbb.112.1427465065506; Fri, 27 Mar 2015 07:04:25 -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 k9csp1280855lbq; Fri, 27 Mar 2015 07:04:24 -0700 (PDT) X-Received: by 10.66.216.67 with SMTP id oo3mr34742409pac.133.1427465063586; Fri, 27 Mar 2015 07:04:23 -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.22; Fri, 27 Mar 2015 07:04:23 -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 S1030208AbbC0OD5 (ORCPT + 7 others); Fri, 27 Mar 2015 10:03:57 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:34981 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030189AbbC0ODz (ORCPT ); Fri, 27 Mar 2015 10:03:55 -0400 Received: by pdbop1 with SMTP id op1so97461177pdb.2 for ; Fri, 27 Mar 2015 07:03:55 -0700 (PDT) X-Received: by 10.70.55.65 with SMTP id q1mr35995424pdp.35.1427465035382; Fri, 27 Mar 2015 07:03:55 -0700 (PDT) Received: from localhost ([104.207.83.1]) by mx.google.com with ESMTPSA id pq1sm2325101pbb.23.2015.03.27.07.03.53 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Mar 2015 07:03:54 -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 4/7] Xen / ACPI / processor: use invalid_logical_cpuid() Date: Fri, 27 Mar 2015 22:02:25 +0800 Message-Id: <1427464948-14564-5-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-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.46 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; /*