[mingo-tip:master 1850/2375] arch/mips/ralink/mt7620.c:59:9: error: implicit declaration of function 'do_div'

From: kernel test robot
Date: Mon Jan 10 2022 - 04:39:36 EST


tree: git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git master
head: 391ce485ced0e47bf8d2ce8bc32bb87887e16656
commit: d10ef57285dc3c6092c8c535c0bbd77e1cf09b08 [1850/2375] headers/deps: cpumask: Optimize <linux/cpumask.h>, remove <linux/cpumask_api.h>
config: mips-vocore2_defconfig (https://download.01.org/0day-ci/archive/20220110/202201101720.QTGys8N9-lkp@xxxxxxxxx/config)
compiler: mipsel-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/commit/?id=d10ef57285dc3c6092c8c535c0bbd77e1cf09b08
git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
git fetch --no-tags mingo-tip master
git checkout d10ef57285dc3c6092c8c535c0bbd77e1cf09b08
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash arch/mips/ralink/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

arch/mips/ralink/mt7620.c: In function 'mt7620_calc_rate':
>> arch/mips/ralink/mt7620.c:59:9: error: implicit declaration of function 'do_div' [-Werror=implicit-function-declaration]
59 | do_div(t, div);
| ^~~~~~
cc1: some warnings being treated as errors


vim +/do_div +59 arch/mips/ralink/mt7620.c

594bde683d36c3 John Crispin 2013-03-21 51
ded1e9d727f0e7 Gabor Juhos 2013-08-23 52 static __init u32
ded1e9d727f0e7 Gabor Juhos 2013-08-23 53 mt7620_calc_rate(u32 ref_rate, u32 mul, u32 div)
ded1e9d727f0e7 Gabor Juhos 2013-08-23 54 {
ded1e9d727f0e7 Gabor Juhos 2013-08-23 55 u64 t;
ded1e9d727f0e7 Gabor Juhos 2013-08-23 56
ded1e9d727f0e7 Gabor Juhos 2013-08-23 57 t = ref_rate;
ded1e9d727f0e7 Gabor Juhos 2013-08-23 58 t *= mul;
ded1e9d727f0e7 Gabor Juhos 2013-08-23 @59 do_div(t, div);
ded1e9d727f0e7 Gabor Juhos 2013-08-23 60
ded1e9d727f0e7 Gabor Juhos 2013-08-23 61 return t;
ded1e9d727f0e7 Gabor Juhos 2013-08-23 62 }
ded1e9d727f0e7 Gabor Juhos 2013-08-23 63

:::::: The code at line 59 was first introduced by commit
:::::: ded1e9d727f0e7cb1cf7f243dac2a87974ae048f MIPS: ralink: mt7620: Improve clock frequency detection

:::::: TO: Gabor Juhos <juhosg@xxxxxxxxxxx>
:::::: CC: Ralf Baechle <ralf@xxxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx