Received: by 10.223.176.5 with SMTP id f5csp2913318wra; Mon, 5 Feb 2018 12:09:21 -0800 (PST) X-Google-Smtp-Source: AH8x2245bCnF/dK3qQd9dbaCJlcQa2/0+8jDlB8awOBVXavGm0PkG0GjqyZafW9/CZ7G4/Tmo8Cw X-Received: by 2002:a17:902:4324:: with SMTP id i33-v6mr8341124pld.39.1517861361627; Mon, 05 Feb 2018 12:09:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517861361; cv=none; d=google.com; s=arc-20160816; b=JpVFysE5fdEGo+IxdlC3YT5a+sXN8rw7UXy2eQ8yfna7AlgixKcyTQCmhppiNFZVBc 90Q8cJ7epJJpnFBL/ILAHKjHE7Yz4Tx0drSOF/lBqXfd0nY7fy0IZ71sZ/sQwFIKMBoz jvD2IObz8TV/0jA5Ot8WsgSAuWDFp4z5snlZS+dwyfvZ5GLfACKkq+thPQh8v3y2pzwo AlQe3rifvqUaDKrOPWQADzDaJG2F95HWjgRY5pswQenjggEHMnQygpa05ZBnkYjF/C/E lEF9csNyTWAa/tPST6zYvQd0O7FcaMhsof/hMWr0j4pIm/Djy928WDaiLLA5PJqddl39 IMSA== 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=sVOtvUBSe3h+SYSM9bGZ3RBmmBQGSguXWWo7oyX6McU=; b=ds3rCEyYmxkmtuH656I5U5bGMygkM8PQnreYTNFBjAgNIhrR8QLahKBLu9lYMHqczO sKGbT+W1hlVyAmnZoxV4gT3FmfNL8l4qaa4oBo/hCFtiemr2gN7vk89IrBpRMS4stP+S YzUQ47Z7xCWVILvZd/cXbym3o3rAc5SEhVBWSoU3Ivl3gV2itbXTdruNbiq3uAqS8rlm 70tuzypoEi2mpGrkK5BG/1Qx7r+x8JJNTZFajhO5Q/Y2ZFgRx3dfgQXUCaFpn9eHPYc4 vF00H0Teu/1mFUA6Kw3o73BaDaR2R95uywKf409SzI9G2MeWaq/re/gw7Z2axR+RVyxy M+LA== 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 az2-v6si1307057plb.370.2018.02.05.12.09.06; Mon, 05 Feb 2018 12:09:21 -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 S1751881AbeBEUHC (ORCPT + 99 others); Mon, 5 Feb 2018 15:07:02 -0500 Received: from gateway30.websitewelcome.com ([192.185.149.4]:26599 "EHLO gateway30.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751853AbeBEUG4 (ORCPT ); Mon, 5 Feb 2018 15:06:56 -0500 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway30.websitewelcome.com (Postfix) with ESMTP id B428ED72B for ; Mon, 5 Feb 2018 14:06:55 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id in2VeFjKlvkfxin2Vej3at; Mon, 05 Feb 2018 14:06:55 -0600 Received: from [189.152.201.65] (port=46578 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1ein2V-003HTV-Dk; Mon, 05 Feb 2018 14:06:55 -0600 Date: Mon, 5 Feb 2018 14:06:55 -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 2/8] dvb-frontends: ves1820: use 64-bit arithmetic instead of 32-bit Message-ID: <6e8742889d7c7f087e1b698409370bb5da5cd7ff.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: 1ein2V-003HTV-Dk X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.152.201.65]:46578 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 17 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 10 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 fpxin = state->config->xin * 10 is currently being evaluated using 32-bit arithmetic. Addresses-Coverity-ID: 200604 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Update subject and changelog to better reflect the proposed code changes. - Add suffix ULL to constant instead of casting a variable. drivers/media/dvb-frontends/ves1820.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/ves1820.c b/drivers/media/dvb-frontends/ves1820.c index 1d89792..1760098 100644 --- a/drivers/media/dvb-frontends/ves1820.c +++ b/drivers/media/dvb-frontends/ves1820.c @@ -137,7 +137,7 @@ static int ves1820_set_symbolrate(struct ves1820_state *state, u32 symbolrate) NDEC = 3; /* yeuch! */ - fpxin = state->config->xin * 10; + fpxin = state->config->xin * 10ULL; fptmp = fpxin; do_div(fptmp, 123); if (symbolrate < fptmp) SFIL = 1; -- 2.7.4