Skip to contentSkip to conversation

drivers/clk/sunxi-ng/ccu_nkm.c:50:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead.

PATCH kernel test robot 1 participant 1 message Nov 15

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi/clk-for-7.5
head:   63a29fbb4ecdadbaccd2693864616918698e1e58
commit: e9d9dae0d248cb9a102ba90adbef2cfe198d832c [2/16] clk: sunxi-ng: nkm: avoid 32-bit overflow in rate calculations
config: xtensa-randconfig-r2101-20261115 (https://download.01.org/0day-ci/archive/20261115/[email protected]/config)
compiler: xtensa-linux-gcc (GCC) 8.5.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

cocci warnings: (new ones prefixed by >>)

>> drivers/clk/sunxi-ng/ccu_nkm.c:50:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead.

drivers/clk/sunxi-ng/ccu_nkm.c:40:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead.

vim +50 drivers/clk/sunxi-ng/ccu_nkm.c

    43	
    44	static unsigned long ccu_nkm_calc_parent_rate(unsigned long rate,
    45						      unsigned long n, unsigned long k,
    46						      unsigned long m)
    47	{
    48		u64 parent = (u64)rate * m;
    49	
  > 50		do_div(parent, n * k);
    51		return min_t(u64, parent, ULONG_MAX);
    52	}
    53	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki