Skip to content

Commit 0a7c2fd

Browse files
arndbbebarino
authored andcommitted
clk: sophgo: avoid open-coded 64-bit division
On 32-bit architectures, the 64-bit division leads to a link failure: arm-linux-gnueabi-ld: drivers/clk/sophgo/clk-cv18xx-pll.o: in function `fpll_calc_rate': clk-cv18xx-pll.c:(.text.fpll_calc_rate+0x26): undefined reference to `__aeabi_uldivmod' This one is not called in a fast path, and there is already another div_u64() variant used in the same function, so convert it to div64_u64_rem(). Fixes: 80fd61e ("clk: sophgo: Add clock support for CV1800 SoC") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20240415134532.3467817-1-arnd@kernel.org Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202404122344.d5pb2N1I-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202404140310.QEjZKtTN-lkp@intel.com/ Reviewed-by: Inochi Amaoto <inochiama@outlook.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent a12069a commit 0a7c2fd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/clk/sophgo/clk-cv18xx-pll.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ static unsigned long fpll_calc_rate(unsigned long parent_rate,
205205
unsigned long rate;
206206

207207
dividend <<= PLL_SYN_FACTOR_DOT_POS - 1;
208-
rate = dividend / factor;
209-
dividend %= factor;
208+
rate = div64_u64_rem(dividend, factor, &dividend);
210209

211210
if (is_full_parent) {
212211
dividend <<= 1;

0 commit comments

Comments
 (0)