Received: by 10.223.176.5 with SMTP id f5csp2144916wra; Thu, 8 Feb 2018 09:07:53 -0800 (PST) X-Google-Smtp-Source: AH8x226TRDg0gQkj2tuH2/5kI+T7X+pROmVv7mH5rYD+zNDD5fuB2FRHLfgKqe7bP9rnuHYOEOr7 X-Received: by 2002:a17:902:650e:: with SMTP id b14-v6mr1220908plk.451.1518109673696; Thu, 08 Feb 2018 09:07:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518109673; cv=none; d=google.com; s=arc-20160816; b=DnPxpPHfHY4PBwiNnNwlEdl69FODVS4DmfAiN5Nqfbvvb36zAfHbdiu8xxP20MEYbQ jncnm+S6THlPUU9sVokd2BrQ1+0Z6y8EkaRXcO1Eo3kwfOVbukBELcQHrss5qo374nJE OXnEMshxCViqRm45mxu9SKHUkB/F3YV8sCG+6ChY+UT9DA2zzSt/uY9FDVLfoseinGEb b85X3Dm0jfsoC1spMVzMIvY1YMF4HUVRo/EoxylHExH8g2jSAohB41EUFXjRImY6AQmE xAG4YptbYQc/+Z2ZTrBuO+OVNheqyMjrDBp3uMDttu2qmv/6nMSC0uS2osnsChaBS3nm OW2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=g80ONiaD9zh+MyILG/boUT8qoD4FqMhQmYBBrPXUlMQ=; b=Z7wr+isMa2vX2g9A2wh3F002J53d4RW3Syq5kDMhXK+V4zxdlavhHrLQRcrIyIXWBD O0h4tn/BbpCwRDq2luLIR3Qy0mrWVQuGXwHXujlxhtYcvq934PocP8ZLsbXRYrKXPB6U +lCSZyazQspYlkFMuEtbTTWZb2vtF7Bk510hXqd5j3Q0kLvcIHb8a6bj/mnxV1zdwMRX 4CJjCENmks4EACWTqrjp8w8YLsCxVipEeJahlRr7HMXyOG5H+pgH9U9pi+4CU4WFGhkh VeSvhBu7NVPEdlN160jSlqogZ+ZZNTcfr3PeT3nZu+gtX6bkJRz3oyjFcq7hT1kLw6pZ Tc6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q74si209802pfk.164.2018.02.08.09.07.37; Thu, 08 Feb 2018 09:07:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752046AbeBHRFC (ORCPT + 99 others); Thu, 8 Feb 2018 12:05:02 -0500 Received: from gateway36.websitewelcome.com ([192.185.193.12]:33299 "EHLO gateway36.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751094AbeBHRFB (ORCPT ); Thu, 8 Feb 2018 12:05:01 -0500 X-Greylist: delayed 1461 seconds by postgrey-1.27 at vger.kernel.org; Thu, 08 Feb 2018 12:05:01 EST Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 0962F40173479 for ; Thu, 8 Feb 2018 10:40:40 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id jpFXekWmpzzFjjpFYeNqaz; Thu, 08 Feb 2018 10:40:40 -0600 Received: from [189.175.4.238] (port=51026 helo=[192.168.1.69]) by gator4166.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1ejpFX-002jTM-KD; Thu, 08 Feb 2018 10:40:39 -0600 Subject: Re: [PATCH] ACPI / CPPC: Use 64-bit arithmetic instead of 32-bit To: "Rafael J. Wysocki" , "Gustavo A. R. Silva" Cc: Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180206233617.GA30829@embeddedgus> <2503109.MpnWDuSnnD@aspire.rjw.lan> From: "Gustavo A. R. Silva" Message-ID: <1f5cffd5-4806-a8e6-48d7-bc2f8ec1d440@embeddedor.com> Date: Thu, 8 Feb 2018 10:40:38 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <2503109.MpnWDuSnnD@aspire.rjw.lan> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.175.4.238 X-Source-L: No X-Exim-ID: 1ejpFX-002jTM-KD X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.1.69]) [189.175.4.238]:51026 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 8 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/08/2018 03:49 AM, Rafael J. Wysocki wrote: > On Wednesday, February 7, 2018 12:36:17 AM CET Gustavo A. R. Silva wrote: >> Add suffix ULL to constant 500 in order to give the compiler complete >> information about the proper arithmetic to use. Notice that this >> constant is used in a context that expects an expression of type >> u64 (64 bits, unsigned). >> >> The expression NUM_RETRIES * cppc_ss->latency at line 578, which at >> preprocessing time translates to 500 * cppc_ss->latency is currently >> being evaluated using 32-bit arithmetic. >> >> Addresses-Coverity-ID: 1382602 >> Signed-off-by: Gustavo A. R. Silva >> --- >> Notice that another option is to cast NUM_RETRIES to u64 at line 578, >> but as there is only one instace in which this macro is being used I >> think adding the ULL is just enough. >> >> drivers/acpi/cppc_acpi.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c >> index 06ea474..0afbb26 100644 >> --- a/drivers/acpi/cppc_acpi.c >> +++ b/drivers/acpi/cppc_acpi.c >> @@ -119,7 +119,7 @@ static DEFINE_PER_CPU(struct cpc_desc *, cpc_desc_ptr); >> * to PCC commands. Keeping it high enough to cover emulators where >> * the processors run painfully slow. >> */ >> -#define NUM_RETRIES 500 >> +#define NUM_RETRIES 500ULL >> >> struct cppc_attr { >> struct attribute attr; >> > > Applied, thanks! > > Thank you, Rafael. -- Gustavo