From patchwork Fri Mar 27 13:55:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 46415 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6330E21597 for ; Fri, 27 Mar 2015 13:57:29 +0000 (UTC) Received: by lbbug6 with SMTP id ug6sf10907287lbb.3 for ; Fri, 27 Mar 2015 06:57:28 -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=VhMIXJMW5eoksOf0dGs33byaPyNXak0l43VuPBQpypFlwI+gVk74RX/ImyEhIfVszp cgW5oxeK6yKNzRkczK9cfnJGRF6x7RYvq6uRzJVFhAxOXIQySo8o/pI7haI8wOXkdVhB Wo4/W5wsd0hsbpeje3gS/RRKjMOP48KAXvZAaOHTO9rO5eoQYA6QFD1mp83Up/VvZu8r C6JHDoEbqGl0V/7eipibQo9WnqUzgQQTLTJhifb1oegvb4+Uh6UAwDEItQShBiNwWnAj MGybeBh0KrXHZuLfXQUp5DwlgVuy8Zgk+i2nF7AkzEm8yyOD/RZZAsmH2tDbg5CSIewI 7siw== X-Gm-Message-State: ALoCoQnTxRXyrB41EIVB1ymZtYa4EVI4WbOlc7UiUPudVsNpQTsRu9aSV7hcgYDWx5HVKtfrXKVf X-Received: by 10.112.44.167 with SMTP id f7mr4788507lbm.9.1427464648363; Fri, 27 Mar 2015 06:57:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.233 with SMTP id y9ls395181lae.9.gmail; Fri, 27 Mar 2015 06:57:28 -0700 (PDT) X-Received: by 10.112.132.35 with SMTP id or3mr6316499lbb.85.1427464648098; Fri, 27 Mar 2015 06:57:28 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id ls2si30341lac.115.2015.03.27.06.57.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 06:57:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lboc7 with SMTP id c7so7269888lbo.1 for ; Fri, 27 Mar 2015 06:57:28 -0700 (PDT) X-Received: by 10.112.218.5 with SMTP id pc5mr18497840lbc.32.1427464648009; Fri, 27 Mar 2015 06:57:28 -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 k9csp1276453lbq; Fri, 27 Mar 2015 06:57:27 -0700 (PDT) X-Received: by 10.66.189.105 with SMTP id gh9mr35050073pac.41.1427464643629; Fri, 27 Mar 2015 06:57:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si2995739pdo.31.2015.03.27.06.57.22; Fri, 27 Mar 2015 06:57: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 S964822AbbC0N5U (ORCPT + 7 others); Fri, 27 Mar 2015 09:57:20 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:33796 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753092AbbC0N4O (ORCPT ); Fri, 27 Mar 2015 09:56:14 -0400 Received: by pacwe9 with SMTP id we9so96474123pac.1 for ; Fri, 27 Mar 2015 06:56:13 -0700 (PDT) X-Received: by 10.68.57.137 with SMTP id i9mr35796834pbq.69.1427464573391; Fri, 27 Mar 2015 06:56:13 -0700 (PDT) Received: from localhost ([104.207.83.1]) by mx.google.com with ESMTPSA id bo2sm2312433pbb.1.2015.03.27.06.56.11 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Mar 2015 06:56:12 -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 21:55:10 +0800 Message-Id: <1427464513-14414-7-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-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.179 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; /*