Re: [PATCH v2 next 2/4] lib: mul_u64_u64_div_u64() Use BUG_ON() for divide by zero

From: kernel test robot
Date: Sun May 18 2025 - 11:43:54 EST


Hi David,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20250516]

url: https://github.com/intel-lab-lkp/linux/commits/David-Laight/lib-mul_u64_u64_div_u64-rename-parameter-c-to-d/20250518-214037
base: next-20250516
patch link: https://lore.kernel.org/r/20250518133848.5811-3-david.laight.linux%40gmail.com
patch subject: [PATCH v2 next 2/4] lib: mul_u64_u64_div_u64() Use BUG_ON() for divide by zero
config: openrisc-allnoconfig (https://download.01.org/0day-ci/archive/20250518/202505182351.bPFZE1vO-lkp@xxxxxxxxx/config)
compiler: or1k-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250518/202505182351.bPFZE1vO-lkp@xxxxxxxxx/reproduce)

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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505182351.bPFZE1vO-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

lib/math/div64.c: In function 'mul_u64_u64_div_u64':
>> lib/math/div64.c:190:9: error: implicit declaration of function 'BUG_ON' [-Wimplicit-function-declaration]
190 | BUG_ON(!d);
| ^~~~~~


vim +/BUG_ON +190 lib/math/div64.c

185
186 #ifndef mul_u64_u64_div_u64
187 u64 mul_u64_u64_div_u64(u64 a, u64 b, u64 d)
188 {
189 /* Trigger exception if divisor is zero */
> 190 BUG_ON(!d);
191
192 if (ilog2(a) + ilog2(b) <= 62)
193 return div64_u64(a * b, d);
194

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki