From: cgel.zte@gmail.com
To: avifishman70@gmail.com
Cc: benjaminfair@google.com, sboyd@kernel.org, venture@google.com,
mturquette@baylibre.com, Zeal Robot <zealci@zte.com.cn>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
tali.perry1@gmail.com,
Changcheng Deng <deng.changcheng@zte.com.cn>,
openbmc@lists.ozlabs.org, tmaimon77@gmail.com
Subject: [PATCH] clk: Use div64_ul instead of do_div
Date: Wed, 17 Nov 2021 01:12:44 +0000 [thread overview]
Message-ID: <20211117011244.158541-1-deng.changcheng@zte.com.cn> (raw)
From: Changcheng Deng <deng.changcheng@zte.com.cn>
do_div() does a 64-by-32 division. If the divisor is unsigned long, using
div64_ul can avoid truncation to 32-bit.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
---
drivers/clk/clk-npcm7xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk-npcm7xx.c b/drivers/clk/clk-npcm7xx.c
index e677bb5a784b..c75880af2b74 100644
--- a/drivers/clk/clk-npcm7xx.c
+++ b/drivers/clk/clk-npcm7xx.c
@@ -56,7 +56,7 @@ static unsigned long npcm7xx_clk_pll_recalc_rate(struct clk_hw *hw,
otdv2 = FIELD_GET(PLLCON_OTDV2, val);
ret = (u64)parent_rate * fbdv;
- do_div(ret, indv * otdv1 * otdv2);
+ div64_ul(ret, indv * otdv1 * otdv2);
return ret;
}
--
2.25.1
next reply other threads:[~2021-11-17 3:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 1:12 cgel.zte [this message]
2021-11-18 8:28 ` [PATCH v2] clk: Use div64_ul instead of do_div cgel.zte
2021-12-02 23:15 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211117011244.158541-1-deng.changcheng@zte.com.cn \
--to=cgel.zte@gmail.com \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=deng.changcheng@zte.com.cn \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=openbmc@lists.ozlabs.org \
--cc=sboyd@kernel.org \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).