From patchwork Wed Feb 7 16:00:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 10205485 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 88B9D602D8 for ; Wed, 7 Feb 2018 16:00:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EBD429034 for ; Wed, 7 Feb 2018 16:00:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4333729040; Wed, 7 Feb 2018 16:00:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 321F929034 for ; Wed, 7 Feb 2018 16:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=trVkK3JkP8xvoKqGdoJLFIEYmM3HvSgOrBBTMlCReJ0=; b=DKu8fC/H+ek9xR VPN57Pigfj5Y091dc9twnol/DlhiXy+xU7KRLxYBVCpeTa/4BDX59QUkU+odVYH0ig0O6AAEeMQwu FUBNaC/5pDf/l/xd2hQIbhtf0Td/iRkEveQq/OxsSOiy0jgLEKnis7ixQZ/TEkibEhva5lcpTajrz 3+YZ6oysUkzuhXcmp3V1TYf3GGfQc+cNxZViJ7wjR7rwOFMhD7Z34qmfALbmTBQRU6QuEDAv6rRHv JeDtjfYOsYAkFFx/pnem3BpjQhrOuuf4+AvU6MpjHuDnKU+o+kfPkl/kTpGp+vVEKSb+fE/gIC9Lh C6ZLUzSxgPrzc9gOwWEw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ejS99-0007ru-Kd; Wed, 07 Feb 2018 16:00:31 +0000 Received: from gateway20.websitewelcome.com ([192.185.49.40]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ejS96-00072O-BK for linux-arm-kernel@lists.infradead.org; Wed, 07 Feb 2018 16:00:30 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 7183A400C74C7 for ; Wed, 7 Feb 2018 10:00:05 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id jS8jeGmlxBUMKjS8jeJuPC; Wed, 07 Feb 2018 10:00:05 -0600 Received: from [189.175.4.238] (port=60150 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1ejS8h-0044mw-L1; Wed, 07 Feb 2018 10:00:03 -0600 Date: Wed, 7 Feb 2018 10:00:02 -0600 From: "Gustavo A. R. Silva" To: Mark Brown , Eric Anholt , Stefan Wahren , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com Subject: [PATCH] spi: bcm2835aux: use 64-bit arithmetic instead of 32-bit Message-ID: <20180207160002.GA9292@embeddedgus> MIME-Version: 1.0 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 - lists.infradead.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: 1ejS8h-0044mw-L1 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.175.4.238]:60150 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 10 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add suffix ULL to constant 9 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 unsigned long long (64 bits, unsigned). The expression tfr->len * 9 * 1000000 is currently being evaluated using 32-bit arithmetic. Addresses-Coverity-ID: 1339619 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Eric Anholt --- drivers/spi/spi-bcm2835aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c index 7428091..a768c23 100644 --- a/drivers/spi/spi-bcm2835aux.c +++ b/drivers/spi/spi-bcm2835aux.c @@ -363,7 +363,7 @@ static int bcm2835aux_spi_transfer_one(struct spi_master *master, * chunk getting transferred - in our case the chunk size * is 3 bytes, so we approximate this by 9 bits/byte */ - xfer_time_us = tfr->len * 9 * 1000000; + xfer_time_us = tfr->len * 9ULL * 1000000; do_div(xfer_time_us, spi_used_hz); /* run in polling mode for short transfers */