include/linux/array_size.h:11:38: warning: division by zero

kernel test robot <[email protected]> Fri, 31 Jul 2026 02:48:13 +0800
Newsgroups dev.linux.lists.oe-kbuild
Message-ID <[email protected]>
:::::: 
:::::: Manual check reason: "bisect to a FBC not belonging to original linux-review patches: branch: linux-review/Koichiro-Den/dmaengine-dw-edma-Add-dw_edma_core_ll_cur_idx-to-get-current-LL-entry-index/20260730-102226, commit: 03f5304bf0171912c566bfcc1a639cbb665c9a4c"
:::::: 

BCC: [email protected]
CC: [email protected]
TO: Koichiro Den <[email protected]>
CC: 0day robot <[email protected]>

tree:   https://github.com/intel-lab-lkp/linux/commits/Koichiro-Den/dmaengine-dw-edma-Add-dw_edma_core_ll_cur_idx-to-get-current-LL-entry-index/20260730-102226
head:   ae65ed7a2832f6e535080ff77119c27abc812175
commit: 03f5304bf0171912c566bfcc1a639cbb665c9a4c dmaengine: dw-edma: Serialize LL event capture with channel kicks
date:   16 hours ago
:::::: branch date: 16 hours ago
:::::: commit date: 16 hours ago
config: alpha-randconfig-r063-20260730 (https://download.01.org/0day-ci/archive/20260731/[email protected]/config)
compiler: alpha-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260731/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

All warnings (new ones prefixed by >>):

   In file included from include/linux/string.h:6,
                    from include/linux/bitmap.h:13,
                    from include/linux/cpumask.h:11,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/spinlock.h:63,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:7,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:18,
                    from drivers/dma/dw-edma/dw-edma-core.c:9:
   drivers/dma/dw-edma/dw-edma-core.c: In function 'dw_edma_probe':
>> include/linux/array_size.h:11:38: warning: division by zero [-Wdiv-by-zero]
      11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
         |                                      ^
   drivers/dma/dw-edma/dw-edma-core.c:1401:18: note: in expansion of macro 'ARRAY_SIZE'
    1401 |  for (i = 0; i < ARRAY_SIZE(dw->event_lock_per_dir); i++)
         |                  ^~~~~~~~~~


vim +11 include/linux/array_size.h

3cd39bc3b11b8d Alejandro Colomar 2023-10-03   6  
3cd39bc3b11b8d Alejandro Colomar 2023-10-03   7  /**
3cd39bc3b11b8d Alejandro Colomar 2023-10-03   8   * ARRAY_SIZE - get the number of elements in array @arr
3cd39bc3b11b8d Alejandro Colomar 2023-10-03   9   * @arr: array to be sized
3cd39bc3b11b8d Alejandro Colomar 2023-10-03  10   */
3cd39bc3b11b8d Alejandro Colomar 2023-10-03 @11  #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
3cd39bc3b11b8d Alejandro Colomar 2023-10-03  12  

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