From patchwork Wed Nov 26 09:53:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 41530 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 77038203C2 for ; Wed, 26 Nov 2014 09:55:27 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf1704346wiv.1 for ; Wed, 26 Nov 2014 01:55:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=iDa7o8je5ZjzLhp3KPwGeE834dqqhDGChUnOkkaQ4dE=; b=SZifxOyRshafKuOm/v1JcyZUUssIqtBQim6XZ0ZWO2PwQWbhdHD0x+ZoNiinueL3NA KHyuSmn8LTPSjgIjUl6i/4FZ96QBsx6OL1zsQy8dyA5CZKP+uYSqXTWvxIz2iRud/fPy x7EVPca+jXo2KkdYOGbbc/ShBTlFZfce2X2DmFipmahO/6Obq7zqw2Z7Dh/PwiM4oL4e 2d+U3smGlpKJ413i6Mb+na8h6Y6FoFGD1TOutJf/9Qh9tgLcCxO+jqjxxYhvkHo/wYwI QfpbJalSvOnoedqCyZxXCvimR+0qtmmv01lCXpFaiQq2xCkecCDYXO79Q1rnW7dAXB6U Wm9g== X-Gm-Message-State: ALoCoQkBVH2L/bAduF/rrE0/4Pwls8p6eb92L7JMOeQuiiQZqf56pf2EP8ZeN25zrdNx8A+Jm3wr X-Received: by 10.180.19.226 with SMTP id i2mr6802975wie.5.1416995726766; Wed, 26 Nov 2014 01:55:26 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.11.6 with SMTP id ee6ls386579lad.7.gmail; Wed, 26 Nov 2014 01:55:26 -0800 (PST) X-Received: by 10.112.201.226 with SMTP id kd2mr22186876lbc.98.1416995726151; Wed, 26 Nov 2014 01:55:26 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id ev4si3819774lbc.105.2014.11.26.01.55.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Nov 2014 01:55:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gm9so2184414lab.12 for ; Wed, 26 Nov 2014 01:55:26 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr32597979lbc.23.1416995726036; Wed, 26 Nov 2014 01:55:26 -0800 (PST) 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.184.201 with SMTP id ew9csp593553lbc; Wed, 26 Nov 2014 01:55:25 -0800 (PST) X-Received: by 10.70.26.100 with SMTP id k4mr10763338pdg.101.1416995724407; Wed, 26 Nov 2014 01:55:24 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf4si5821760pbc.244.2014.11.26.01.55.23 for ; Wed, 26 Nov 2014 01:55:24 -0800 (PST) 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 S1750834AbaKZJzW (ORCPT + 6 others); Wed, 26 Nov 2014 04:55:22 -0500 Received: from mail-pd0-f170.google.com ([209.85.192.170]:64694 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750811AbaKZJzT (ORCPT ); Wed, 26 Nov 2014 04:55:19 -0500 Received: by mail-pd0-f170.google.com with SMTP id fp1so2505873pdb.15 for ; Wed, 26 Nov 2014 01:55:19 -0800 (PST) X-Received: by 10.70.131.199 with SMTP id oo7mr52251437pdb.138.1416995719296; Wed, 26 Nov 2014 01:55:19 -0800 (PST) Received: from [10.21.102.114] ([180.150.157.39]) by mx.google.com with ESMTPSA id c3sm3774560pbu.76.2014.11.26.01.55.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Nov 2014 01:55:18 -0800 (PST) Message-ID: <5475A307.8040605@linaro.org> Date: Wed, 26 Nov 2014 17:53:11 +0800 From: Hanjun Guo User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Sudeep Holla , linux-acpi@vger.kernel.org CC: "Rafael J. Wysocki" Subject: Re: [PATCH 1/3] ACPI / processor: remove incorrect comparison of phys_id References: <1416926930-792-1-git-send-email-sudeep.holla@arm.com> <1416926930-792-2-git-send-email-sudeep.holla@arm.com> In-Reply-To: <1416926930-792-2-git-send-email-sudeep.holla@arm.com> 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.53 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: , Hi Sudeep, On 2014-11-25 22:48, Sudeep Holla wrote: > phys_id in acpi_processor structure is unsigned 32-bit integer, > comparing it with signed value is incorrect. Yes, this is a bug :) But the phys_id in acpi_processor structure should be signed value because acpi_get_phys_id() will return -1 if there if no CPU entry found in MADT table. I found the id in acpi_processor structure should also be signed value by unsigned now, we should fix that too. > > This patch removes that incorrect comparision in acpi_processor_hotadd_init > as the lone user of this function is already checking for correctness > of phys_id before calling it. if (apic_id < 0) acpi_handle_debug(pr->handle, "failed to get CPU APIC ID.\n"); it only check the value and print debug message but no returns, so I think the check in the following patch is still needed. > > Signed-off-by: Sudeep Holla > --- > drivers/acpi/acpi_processor.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c > index c4a8a5666298..eaf56f6ce1eb 100644 > --- a/drivers/acpi/acpi_processor.c > +++ b/drivers/acpi/acpi_processor.c > @@ -170,9 +170,6 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) > acpi_status status; > int ret; > > - if (pr->phys_id == -1) > - return -ENODEV; I prepared a patch below: what do you think? Thanks Hanjun --- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 8e34af9..cfdab24 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -199,8 +199,8 @@ struct acpi_processor_flags { struct acpi_processor { acpi_handle handle; u32 acpi_id; - u32 phys_id; /* CPU hardware ID such as APIC ID for x86 */ - u32 id; /* CPU logical ID allocated by OS */ + int phys_id; /* CPU hardware ID such as APIC ID for x86 */ + int id; /* CPU logical ID allocated by OS */ u32 pblk; int performance_platform_limit; int throttling_platform_limit;