Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3646348pxb; Mon, 24 Jan 2022 14:19:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdPJnjzQcQKcBUrYy7Dlr+VetnFWkcGt3nddmW5vRPoBDUxmuBWcM1jcgMONndOpQ2OM6v X-Received: by 2002:a63:1046:: with SMTP id 6mr13222665pgq.602.1643062769582; Mon, 24 Jan 2022 14:19:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062769; cv=none; d=google.com; s=arc-20160816; b=aUqLqAtwIQ2RZ6xwB00M93ZKtkwHNB5hXgvSE5MEXTe6WA6FHMbgddWMdItrhipeAT rno27PYJ29KbNyGoAmkjus52ByKwlj5hj3DCnmzqAkngiAQ/W2Pl4nEAoOCKP+4kkBHo 7vCQHjjTRmcEpNF0Vu03IU1KU3rl5fwV4InEFmU7nAhCwklay9cseeMnNkt45NpZh5Zm 6mEp4/QD5WcrG7QSWOtFOIjvR4/wmtyF1I+bCmCySbXX1P8LMlKqZt/9Nn10mqymnPt/ WR1qpQk3o9y3KaSMeUXK0OoDE99/CvDVk+WOJhU8y+6Oirib2iAl1UMPsRsz51a5RBgL TUsQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RgAUs2YI5Yz4f2m7stMnb/P3ElGbJIuXpEPgE5cYJnI=; b=f4xLEdbhbOqc8ud7IEX5x3NhcJdR0Fra8+5eb+g4RBoA107WCb/hnx8wi/Ae9sdFHy t+H6EYAOL749SEDm1jjsJk8bDO0MuTa9BHIEkK4YDrvlkKrhHh6EvKE77LiI4JSwscyF KQ0mkLlsgjjvokfkVFU+8onLGpa1RKthphA4151TuciGiqVl+7IAeZgczsH+LTAxXZh1 c1etsh1pR6oknfy2Zjbyps5WjlEUJxDWTwS0wXIPgjcanJFq814ggU0mayUF/1rPKxtQ RCj/rmMkoyc0xyKRzeiJxkEIf0QiWUS+ALpf7S/YbUEBIR0946OqOihjAd5RcZ6V323/ um1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fkynVlNm; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q19si6606702pfk.190.2022.01.24.14.19.14; Mon, 24 Jan 2022 14:19:29 -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=@linuxfoundation.org header.s=korg header.b=fkynVlNm; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1581631AbiAXWMG (ORCPT + 99 others); Mon, 24 Jan 2022 17:12:06 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:42338 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1452837AbiAXV1N (ORCPT ); Mon, 24 Jan 2022 16:27:13 -0500 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 ams.source.kernel.org (Postfix) with ESMTPS id 23289B81057; Mon, 24 Jan 2022 21:27:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46776C340E4; Mon, 24 Jan 2022 21:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059627; bh=Zlb1GxZyQU5sZAlAtxJ1xvGbM1W1LxN/N01mLYXusvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fkynVlNmk8ARsfbZyPhxnKmXSXPiYaF/Ji3AKyV5Muwr3hQ8IVTAssM76TTDMopVk eg4zxuGJqDsW/fC9AvQzx/dCOGAfCB1/OTnVZWyfpm7+CQed+D6xSnYZ243bGt28tM 07Y+TA7p4xxBoFhu9LxnClUCyX6UTFKn5lTqt9cg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zeal Robot , Changcheng Deng , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.16 0679/1039] PM: AVS: qcom-cpr: Use div64_ul instead of do_div Date: Mon, 24 Jan 2022 19:41:08 +0100 Message-Id: <20220124184148.185749635@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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