[mingo-tip:sched/headers 2353/2384] drivers/media/rc/mtk-cir.c:163:15: error: implicit declaration of function 'DIV_ROUND_CLOSEST'
From: kernel test robot
Date: Sat Jan 15 2022 - 02:31:51 EST
tree: git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/headers
head: 4c707c1c0de83967079b4e385012fa5b00e2cd11
commit: 6bdaa08124f2198c510118e5ae8816748e9816df [2353/2384] headers/deps: time: Optimize <linux/time64.h> dependencies, remove <linux/time64_api.h> inclusion
config: mips-randconfig-r036-20220113 (https://download.01.org/0day-ci/archive/20220115/202201151534.1iCJKuH9-lkp@xxxxxxxxx/config)
compiler: mips-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=6bdaa08124f2198c510118e5ae8816748e9816df
git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
git fetch --no-tags mingo-tip sched/headers
git checkout 6bdaa08124f2198c510118e5ae8816748e9816df
# 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 drivers/media/rc/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All errors (new ones prefixed by >>):
drivers/media/rc/mtk-cir.c: In function 'mtk_chk_period':
>> drivers/media/rc/mtk-cir.c:163:15: error: implicit declaration of function 'DIV_ROUND_CLOSEST' [-Werror=implicit-function-declaration]
163 | val = DIV_ROUND_CLOSEST(clk_get_rate(ir->bus),
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/DIV_ROUND_CLOSEST +163 drivers/media/rc/mtk-cir.c
50c3c1ba171f3f Sean Wang 2017-06-30 154
50c3c1ba171f3f Sean Wang 2017-06-30 155 static inline u32 mtk_chk_period(struct mtk_ir *ir)
50c3c1ba171f3f Sean Wang 2017-06-30 156 {
50c3c1ba171f3f Sean Wang 2017-06-30 157 u32 val;
50c3c1ba171f3f Sean Wang 2017-06-30 158
50c3c1ba171f3f Sean Wang 2017-06-30 159 /*
50c3c1ba171f3f Sean Wang 2017-06-30 160 * Period for software decoder used in the
50c3c1ba171f3f Sean Wang 2017-06-30 161 * unit of raw software sampling
50c3c1ba171f3f Sean Wang 2017-06-30 162 */
d904eb0b351fe5 Sean Young 2020-11-29 @163 val = DIV_ROUND_CLOSEST(clk_get_rate(ir->bus),
d904eb0b351fe5 Sean Young 2020-11-29 164 USEC_PER_SEC * ir->data->div / MTK_IR_SAMPLE);
50c3c1ba171f3f Sean Wang 2017-06-30 165
50c3c1ba171f3f Sean Wang 2017-06-30 166 dev_dbg(ir->dev, "@pwm clk = \t%lu\n",
50c3c1ba171f3f Sean Wang 2017-06-30 167 clk_get_rate(ir->bus) / ir->data->div);
50c3c1ba171f3f Sean Wang 2017-06-30 168 dev_dbg(ir->dev, "@chkperiod = %08x\n", val);
50c3c1ba171f3f Sean Wang 2017-06-30 169
50c3c1ba171f3f Sean Wang 2017-06-30 170 return val;
50c3c1ba171f3f Sean Wang 2017-06-30 171 }
50c3c1ba171f3f Sean Wang 2017-06-30 172
:::::: The code at line 163 was first introduced by commit
:::::: d904eb0b351fe5545d9ba5b85844342f49025923 media: mtk-cir: fix calculation of chk period
:::::: TO: Sean Young <sean@xxxxxxxx>
:::::: CC: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx