Received: by 10.223.176.5 with SMTP id f5csp7361wra; Tue, 6 Feb 2018 16:01:27 -0800 (PST) X-Google-Smtp-Source: AH8x226hAANev4wF0R+FEf+xrmCiLmivm+3aONqjggmMH7y0pkU7hf51SSMVAfdcHaYwOJA0ewPh X-Received: by 10.98.64.132 with SMTP id f4mr3600506pfd.232.1517961687661; Tue, 06 Feb 2018 16:01:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517961687; cv=none; d=google.com; s=arc-20160816; b=c4SYj5JoGS5N/jq73fM5rqWUw+2cX4hzLcUdwssTlWZ4DVliW7wQuCGfrlIY9OQaqK sO7ibbUqDtmw5vN3AjqmVwMwnMT9gKqivFkSXuTjFM7YfYVm6yRCePoA6fny+G5EfTxL gfcxfRXmgNMfH1SFyMrrWFxVOGbBY7GHc5IYhW4jkcs6rZDZMURs2gAvyf/9gLhF2mjL fs7lh1fsc8G21OK/OS8Vlv5WQyCS35RGCtvcHXQrsboWxvK8rgQffsdLtnHB9htYrbug QrquU/MT6em0DZSKdoAR/FPUDYXEpmNQeQXIqiiKYm60wU2vUmXZggvTzlj1WtcQ2JGi ZDDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=gDH5+Fp+VmE7XaMobc/uR7ENqavZlwabGV2K3tMjEhI=; b=FKKBodW70d2weUzaksllpKDdxYkanR0+Ny/q//b0uhwFrigTiX/zOI0ZJ5R3kVHnSy Hs9DKL7g4QJB5hirIkoWT9KzZij/P/EW9FeazJ7GsWQhej2A+jrx0s8OKAC6cSAkQMs5 SzEUAFlEihc6H1iOidcM+x7KLXWAk8wwX9DJRwX5l201acnTCCBO0ikSQwg4jY7q/vbw F6qcO34zyx+IdnoFE3VIYqz0n5MtGQiIFOg+ERFfmV1hd1EUMt2cpdw9lwRMr3lQhZq8 UKaX2BGSzLH4HBUuFttcQBDyHiMdkQo7eSmB3z5nTYSqhE+gYEtnhbhCceovpgmU1Zr4 5bEA== 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 i7si116663pgq.209.2018.02.06.16.00.51; Tue, 06 Feb 2018 16:01:27 -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 S1754193AbeBGAAK (ORCPT + 99 others); Tue, 6 Feb 2018 19:00:10 -0500 Received: from gateway36.websitewelcome.com ([192.185.188.18]:34431 "EHLO gateway36.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754148AbeBGAAJ (ORCPT ); Tue, 6 Feb 2018 19:00:09 -0500 X-Greylist: delayed 1430 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Feb 2018 19:00:09 EST Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway36.websitewelcome.com (Postfix) with ESMTP id C147E40128FEE for ; Tue, 6 Feb 2018 17:36:18 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id jCmge1yeXBUMKjCmge5DVo; Tue, 06 Feb 2018 17:36:18 -0600 Received: from [189.175.4.238] (port=36844 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1ejCmg-002f50-CM; Tue, 06 Feb 2018 17:36:18 -0600 Date: Tue, 6 Feb 2018 17:36:17 -0600 From: "Gustavo A. R. Silva" To: "Rafael J. Wysocki" , Len Brown Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] ACPI / CPPC: Use 64-bit arithmetic instead of 32-bit Message-ID: <20180206233617.GA30829@embeddedgus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) 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: 1ejCmg-002f50-CM X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.175.4.238]:36844 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 4 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 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; -- 2.7.4