public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: wuyonggang001@208suo.com
To: mturquette@baylibre.com, sboyd@kernel.org
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] clk: baikal-t1: Using div64_ Ul replaces do_ Div() function
Date: Wed, 14 Jun 2023 13:45:48 +0800	[thread overview]
Message-ID: <fcd37e67fba625da304fdaf07e0ab0db@208suo.com> (raw)
In-Reply-To: <0dc9409b662180ed29cbc281f0f076b7@208suo.com>

Fix the following coccicheck warning:

drivers/clk/baikal-t1/ccu-pll.c:81:1-7: WARNING: do_div() does a 
64-by-32 division, please consider using div64_ul instead.

Signed-off-by: Yonggang Wu <wuyonggang001@208suo.com>
---
  drivers/clk/baikal-t1/ccu-pll.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/baikal-t1/ccu-pll.c 
b/drivers/clk/baikal-t1/ccu-pll.c
index 13ef28001439..d41735c6956a 100644
--- a/drivers/clk/baikal-t1/ccu-pll.c
+++ b/drivers/clk/baikal-t1/ccu-pll.c
@@ -66,7 +66,7 @@ static inline unsigned long 
ccu_pll_lock_delay_us(unsigned long ref_clk,
  {
      u64 us = 500ULL * nr * USEC_PER_SEC;

-    do_div(us, ref_clk);
+    div64_ul(us, ref_clk);

      return us;
  }
@@ -78,9 +78,9 @@ static inline unsigned long ccu_pll_calc_freq(unsigned 
long ref_clk,
  {
      u64 tmp = ref_clk;

-    do_div(tmp, nr);
+    div64_ul(tmp, nr);
      tmp *= nf;
-    do_div(tmp, od);
+    div64_ul(tmp, od);

      return tmp;
  }

       reply	other threads:[~2023-06-14  5:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230612033904.34921-1-zhanglibing@cdjrlc.com>
     [not found] ` <0dc9409b662180ed29cbc281f0f076b7@208suo.com>
2023-06-14  5:45   ` wuyonggang001 [this message]
2023-07-19 22:08     ` [PATCH] clk: baikal-t1: Using div64_ Ul replaces do_ Div() function Stephen Boyd
2023-07-24 10:04     ` Geert Uytterhoeven
2023-07-24 13:13       ` Serge Semin
2023-07-24 13:38         ` Geert Uytterhoeven
2023-07-24 14:01           ` David Laight
2023-07-24 14:11           ` Serge Semin
2023-07-27 12:28             ` Serge Semin
2023-07-29  3:24               ` Stephen Boyd
2023-07-31 23:55                 ` Serge Semin

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=fcd37e67fba625da304fdaf07e0ab0db@208suo.com \
    --to=wuyonggang001@208suo.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    /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