Received: by 10.223.176.5 with SMTP id f5csp2928183wra; Mon, 5 Feb 2018 12:28:17 -0800 (PST) X-Google-Smtp-Source: AH8x224tylqOv1GzBpDZRBn2AIFR/ABEneBNnNg4Tc7S/9C9BcIp8qAJYumlydJqciNd/k84v0O8 X-Received: by 10.98.9.67 with SMTP id e64mr40662pfd.230.1517862497812; Mon, 05 Feb 2018 12:28:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517862497; cv=none; d=google.com; s=arc-20160816; b=dHlakoqhsqAbqpQ63Mr3jM0TILVwqXq28OKyJu+G1/L1OJdkb0HBElFcfITR5YaEKb LQ38zEwlnvu/NV4gvaLGBkAEBC0xE6Z+GXgRn2r/XHLF2UjVwl7W/Y2hYkes7WY8S7JC oUNkDMe//32WBeTX7IrSCj8MiQ1/WLtSU4M82B7ETmHtEICnmCg4X4vKdsQMopW6AlZc NLnFBs/sN7i97LfWQ9OATY4bhp3PUTQnuRXazqFPqlc5oSlUNCOIQKyrlays+FkhvDbR OQ9psdN/wwVA8sT4nhvrUVmyvXlAXG/5bSEnCqjicRaMoiO8M16Y3l2A+UNCynIz4s0y o8FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=0/dfhCbR0GOpGxLMtB/XRoxX9WLj6VFQDlnhmUilsYE=; b=Iav/thwuqtZStznx8jIE6857EiApr3WBbC97qwqn94tr+1nsBw1Ft/pAZdKP7mD7Zl +XSLhMBhwQ9XcxcP0/bftnxzbcihoZ344+6AahlVGkbq+aN6xsrZX56VVmKFd3ZPjEPb Yu38P0lajREosSlHXG7iWFyF3z8t7xVHF09ylc7rRSwWdyqR7bpjA/y6gIec94DBZAzx pf0c3VCJ3c/IGREQYoyo3gwlXf7SFKUuiA6XQmo2hAYSk5wm/sz6LZyHV44LzNw+cd5z NoDGtrVZlBLFOcH2aB6dMWfDeqjt1pdvTzxfgta5xQHRT93B1Cz9NM8i4TG9f7yaRRsf 28HA== 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 l2-v6si1143662pli.824.2018.02.05.12.28.03; Mon, 05 Feb 2018 12:28:17 -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 S1751907AbeBEU13 (ORCPT + 99 others); Mon, 5 Feb 2018 15:27:29 -0500 Received: from gateway30.websitewelcome.com ([192.185.150.24]:45008 "EHLO gateway30.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750855AbeBEU1X (ORCPT ); Mon, 5 Feb 2018 15:27:23 -0500 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 0C63BD73B for ; Mon, 5 Feb 2018 14:27:23 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id inMJefUZxzzFjinMJeJIRq; Mon, 05 Feb 2018 14:27:23 -0600 Received: from [189.152.201.65] (port=47692 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1einMI-003Z0P-MT; Mon, 05 Feb 2018 14:27:22 -0600 Date: Mon, 5 Feb 2018 14:27:22 -0600 From: "Gustavo A. R. Silva" To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH v2 5/8] pci: cx88-input: use 64-bit arithmetic instead of 32-bit Message-ID: <9db3fe5d4564caf97acb5bee69e92727ada4a633.1517856716.git.gustavo@embeddedor.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.152.201.65 X-Source-L: No X-Exim-ID: 1einMI-003Z0P-MT X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.152.201.65]:47692 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 27 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 LL to constant 1000000 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 ktime_t (64 bits, signed). The expression ir->polling * 1000000 is currently being evaluated using 32-bit arithmetic. Addresses-Coverity-ID: 1392628 Addresses-Coverity-ID: 1392630 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Update subject and changelog to better reflect the proposed code changes. - Add suffix LL to constant instead of casting a variable. drivers/media/pci/cx88/cx88-input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c index 4e9953e..6f4e692 100644 --- a/drivers/media/pci/cx88/cx88-input.c +++ b/drivers/media/pci/cx88/cx88-input.c @@ -180,7 +180,7 @@ static enum hrtimer_restart cx88_ir_work(struct hrtimer *timer) struct cx88_IR *ir = container_of(timer, struct cx88_IR, timer); cx88_ir_handle_key(ir); - missed = hrtimer_forward_now(&ir->timer, ir->polling * 1000000); + missed = hrtimer_forward_now(&ir->timer, ir->polling * 1000000LL); if (missed > 1) ir_dprintk("Missed ticks %ld\n", missed - 1); @@ -200,7 +200,7 @@ static int __cx88_ir_start(void *priv) if (ir->polling) { hrtimer_init(&ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); ir->timer.function = cx88_ir_work; - hrtimer_start(&ir->timer, ir->polling * 1000000, + hrtimer_start(&ir->timer, ir->polling * 1000000LL, HRTIMER_MODE_REL); } if (ir->sampling) { -- 2.7.4