[mingo-tip:sched/headers 2357/2384] drivers/usb/chipidea/ci.h:427:32: error: implicit declaration of function '__ffs'

From: kernel test robot
Date: Mon Jan 24 2022 - 23:52:05 EST


tree: git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/headers
head: 4c707c1c0de83967079b4e385012fa5b00e2cd11
commit: 61ea5a6fab5c8fae043a02a100970041dc6a877e [2357/2384] headers/deps: delay: Optimize <linux/delay.h> dependencies, remove <linux/sched.h> inclusion
config: mips-randconfig-m031-20220124 (https://download.01.org/0day-ci/archive/20220125/202201251220.wdEh9zG4-lkp@xxxxxxxxx/config)
compiler: mips64-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=61ea5a6fab5c8fae043a02a100970041dc6a877e
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 61ea5a6fab5c8fae043a02a100970041dc6a877e
# 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/usb/

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

All errors (new ones prefixed by >>):

In file included from drivers/usb/chipidea/otg.c:23:
drivers/usb/chipidea/ci.h: In function 'hw_test_and_write':
>> drivers/usb/chipidea/ci.h:427:32: error: implicit declaration of function '__ffs' [-Werror=implicit-function-declaration]
427 | return (val & mask) >> __ffs(mask);
| ^~~~~
cc1: some warnings being treated as errors


vim +/__ffs +427 drivers/usb/chipidea/ci.h

e443b333629f82 Alexander Shishkin 2012-05-11 411
e443b333629f82 Alexander Shishkin 2012-05-11 412 /**
e443b333629f82 Alexander Shishkin 2012-05-11 413 * hw_test_and_write: tests & writes a hw register
19353881b4afc9 Peter Chen 2014-09-22 414 * @ci: the controller
e443b333629f82 Alexander Shishkin 2012-05-11 415 * @reg: register index
e443b333629f82 Alexander Shishkin 2012-05-11 416 * @mask: bitfield mask
e443b333629f82 Alexander Shishkin 2012-05-11 417 * @data: new value
e443b333629f82 Alexander Shishkin 2012-05-11 418 *
e443b333629f82 Alexander Shishkin 2012-05-11 419 * This function returns register contents
e443b333629f82 Alexander Shishkin 2012-05-11 420 */
8e22978c57087a Alexander Shishkin 2013-06-24 421 static inline u32 hw_test_and_write(struct ci_hdrc *ci, enum ci_hw_regs reg,
e443b333629f82 Alexander Shishkin 2012-05-11 422 u32 mask, u32 data)
e443b333629f82 Alexander Shishkin 2012-05-11 423 {
26c696c678c4ce Richard Zhao 2012-07-07 424 u32 val = hw_read(ci, reg, ~0);
e443b333629f82 Alexander Shishkin 2012-05-11 425
26c696c678c4ce Richard Zhao 2012-07-07 426 hw_write(ci, reg, mask, data);
727b4ddb48dcd8 Felipe Balbi 2013-03-30 @427 return (val & mask) >> __ffs(mask);
e443b333629f82 Alexander Shishkin 2012-05-11 428 }
e443b333629f82 Alexander Shishkin 2012-05-11 429

:::::: The code at line 427 was first introduced by commit
:::::: 727b4ddb48dcd8c9ca81b58ca58191233bdf75aa usb: chipidea: don't redefine __ffs()

:::::: TO: Felipe Balbi <balbi@xxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

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