Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3389956pxb; Mon, 17 Jan 2022 19:24:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlfvTnyF6+KgUx5+NPw2SDr6qgzLTK22FMwR1eChsH6aPW9wu7l9AFEx7OBAg4+T/RMRyq X-Received: by 2002:a17:90a:156:: with SMTP id z22mr37387430pje.191.1642476246366; Mon, 17 Jan 2022 19:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642476246; cv=none; d=google.com; s=arc-20160816; b=T456Bh6km9h0lqJL8t1vaPo6j68MFB7mRrj4BhiLwxBjt0oPALYS/Iyk+4rUzwjR3/ HBeBZ+kVp/54ob1cSE626X+IXHcOs++c9EcS6u9ukJ30o3LVlBo2LXweKS3GbvN0VkK9 FnzzMkEI83Cy5eCZ5TbYbUiJOSCI/FQK1Liz3E7NrAMI6hgV8zzl3ykIKIdQjHUPE+vR P+/CQ8/pmy096JrKT9spg3sqNvXREbVQYxTJmXC7ps96pvt7CjbQ37hu2oPOeM3B7TBr vZqQtmD3S9stlVSJwCoAD5and0AHdrma/GVhMKUcggY29sXhenS4sLaDHjVa/qMLAoke Rxeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RgAUs2YI5Yz4f2m7stMnb/P3ElGbJIuXpEPgE5cYJnI=; b=yxb6Etl80JhACWsfjuaFj0BTbTavQuqL2ONq7XxS8uzrUws76hNxG43AVsapRkp/5T dOFXEJsRBoNnOjRFTeZ6ot863fL00Vt4AcSOIIZGpiXO1gAnciopD80dD/Dju91zMH7v Own+NB7e2az21+AnTVVwOwlqkt2Pl61wEF2P666SNRrpuS7mHoyqCe9nCxq82Shd9D0d THgtbYXL8LCPrIIBq+U9sHgxhk5mLpalf6aT3W6HC4xPxzOF97y/ZZk4Bq9FKFchpeMT cRX653c9mnvCEvZTtkOdbgBwX4Ikmo9E6tJ137L8t38dj0jDgDEJ4GXv+LWDyGCQcrlW iE+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gWgweuE7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u5si20116106ple.209.2022.01.17.19.23.54; Mon, 17 Jan 2022 19:24:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gWgweuE7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344168AbiARCej (ORCPT + 99 others); Mon, 17 Jan 2022 21:34:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345191AbiARCbU (ORCPT ); Mon, 17 Jan 2022 21:31:20 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43F48C07E5FE; Mon, 17 Jan 2022 18:28:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AB760610AB; Tue, 18 Jan 2022 02:28:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 252C7C36AEB; Tue, 18 Jan 2022 02:28:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472911; bh=Zlb1GxZyQU5sZAlAtxJ1xvGbM1W1LxN/N01mLYXusvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gWgweuE7DwAFp+/4BedNB2FmEcv11fK5noZZlBFRT6ckE3ixtQwWzTgoo4KSvgwRj vpQ+d2OdGQQmQjT95VDUgSu0lKCwf487KVLKMcm5AIJbXr9gbIf5RCYv5fu6K11hsG u5HWbd1Hx0qQTfGj0js8sKux/LKeGBQx+EL0ZHeNapd+5TBmCLuqsaiCH24TW3Fy7G 4+B8UUGa5XIScKZ2UiTj5oX5VNrPdLqUC9fUkW78pzkiShLQR8qekm42rbQORnWadZ OZzK54CJ5u2aD+sOhM4aD3ZGe/3isGt/IIq0sA2fOzi6Lmc+oL8j+c1kOQ1Rd9cSHw yRxJo/cpF9/Aw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Changcheng Deng , Zeal Robot , Bjorn Andersson , Sasha Levin , nks@flawful.org, agross@kernel.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 162/217] PM: AVS: qcom-cpr: Use div64_ul instead of do_div Date: Mon, 17 Jan 2022 21:18:45 -0500 Message-Id: <20220118021940.1942199-162-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Changcheng Deng [ Upstream commit 92c550f9ffd2884bb5def52b5c0485a35e452784 ] do_div() does a 64-by-32 division. Here the divisor is an unsigned long which on some platforms is 64 bit wide. So use div64_ul instead of do_div to avoid a possible truncation. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211125014311.45942-1-deng.changcheng@zte.com.cn Signed-off-by: Sasha Levin --- drivers/soc/qcom/cpr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/qcom/cpr.c b/drivers/soc/qcom/cpr.c index 1d818a8ba2089..e9b854ed1bdfd 100644 --- a/drivers/soc/qcom/cpr.c +++ b/drivers/soc/qcom/cpr.c @@ -1010,7 +1010,7 @@ static int cpr_interpolate(const struct corner *corner, int step_volt, return corner->uV; temp = f_diff * (uV_high - uV_low); - do_div(temp, f_high - f_low); + temp = div64_ul(temp, f_high - f_low); /* * max_volt_scale has units of uV/MHz while freq values -- 2.34.1