From patchwork Mon May 11 04:17:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 48195 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 261E621578 for ; Mon, 11 May 2015 04:18:20 +0000 (UTC) Received: by lbbrr5 with SMTP id rr5sf35409732lbb.3 for ; Sun, 10 May 2015 21:18:19 -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=c5EI+a38iXz8muCPBm90cOk+gqMawjZt7Kj4BVp/icQ=; b=KHKXVaxj5rjEWNBdsDnFIj5eVEGjsL/v7WdgAp8jOXj79xF9sxS9rU228XQIqmWdKy NKc+Yxyo9wm6WayWU96m47Oz/ZNgx/s7wmJjfKgxPkqDUCCo63FVIoIiUhz15AwFqX/b ujuDKrGp7hJqXkcRjbj4md1hGGL4SDWM/LKzwfuk7k0s4xq8H9mIdsiZQ3Kny7rpEc41 lij28TnF0uME5XYOtVKCgUqXRLsIRjtvA4rISiaWnsXKUAADtYuwYq7icc74NyHqdDTJ +ifDuOwKCOj8Q9eDVn26H1/tyPG2AIkjH6jNZ5mgjli36JXEvwFFLvB23u/2XtQPWV87 HLlQ== X-Gm-Message-State: ALoCoQnnjPtBhMK6eIBQGlyXmW6IF7pr44o2+6MwLmLfWamhFNFBBk8wC0cXx1H9F+VOPbRAgZFa X-Received: by 10.194.240.164 with SMTP id wb4mr6322172wjc.1.1431317898952; Sun, 10 May 2015 21:18:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.129 with SMTP id m1ls539894laf.76.gmail; Sun, 10 May 2015 21:18:18 -0700 (PDT) X-Received: by 10.152.28.97 with SMTP id a1mr6762456lah.9.1431317898795; Sun, 10 May 2015 21:18:18 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id cj5si7665234lad.8.2015.05.10.21.18.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 May 2015 21:18:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by lagv1 with SMTP id v1so84952599lag.3 for ; Sun, 10 May 2015 21:18:18 -0700 (PDT) X-Received: by 10.152.236.40 with SMTP id ur8mr6680890lac.19.1431317898666; Sun, 10 May 2015 21:18:18 -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.108.230 with SMTP id hn6csp1290221lbb; Sun, 10 May 2015 21:18:17 -0700 (PDT) X-Received: by 10.66.243.69 with SMTP id ww5mr16145250pac.106.1431317896403; Sun, 10 May 2015 21:18:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si5554627pas.76.2015.05.10.21.18.15; Sun, 10 May 2015 21:18:16 -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 S1752293AbbEKESL (ORCPT + 7 others); Mon, 11 May 2015 00:18:11 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:33333 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752268AbbEKESK (ORCPT ); Mon, 11 May 2015 00:18:10 -0400 Received: by pdbnk13 with SMTP id nk13so136513698pdb.0 for ; Sun, 10 May 2015 21:18:09 -0700 (PDT) X-Received: by 10.68.115.42 with SMTP id jl10mr16279865pbb.39.1431317889542; Sun, 10 May 2015 21:18:09 -0700 (PDT) Received: from localhost ([180.150.153.56]) by mx.google.com with ESMTPSA id je2sm3033122pbd.14.2015.05.10.21.18.07 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 10 May 2015 21:18:08 -0700 (PDT) From: Hanjun Guo To: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Cc: Will Deacon , Catalin Marinas , Boris Ostrovsky , Stefano Stabellini , Lorenzo Pieralisi , Sudeep Holla , Konrad Rzeszutek Wilk , linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Hanjun Guo Subject: [PATCH v3 2/7] Xen / ACPI / processor: use invalid_logical_cpuid() Date: Mon, 11 May 2015 12:17:14 +0800 Message-Id: <1431317839-4584-3-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431317839-4584-1-git-send-email-hanjun.guo@linaro.org> References: <1431317839-4584-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.54 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. 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; /*