Re: [PATCH v2 06/20] linux/kernel.h, linux/array_size.h: Split ARRAY_SIZE() into a separate header

From: kernel test robot
Date: Mon Nov 22 2021 - 02:37:23 EST


Hi Alejandro,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linux/master linus/master v5.16-rc2 next-20211118]
[cannot apply to drm-intel/for-linux-next mkl-can-next/testing]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Alejandro-Colomar/linux-stddef-h-linux-offsetof-h-Split-offsetof-into-a-separate-header/20211120-220144
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: ia64-randconfig-r016-20211122 (attached as .config)
compiler: ia64-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://github.com/0day-ci/linux/commit/f4bee28948d96faeac8bdf5ac6d2abdd718d1db3
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alejandro-Colomar/linux-stddef-h-linux-offsetof-h-Split-offsetof-into-a-separate-header/20211120-220144
git checkout f4bee28948d96faeac8bdf5ac6d2abdd718d1db3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=ia64

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

All warnings (new ones prefixed by >>):

In file included from include/linux/kernel.h:6,
from include/linux/cpumask.h:10,
from include/linux/mm_types_task.h:14,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from drivers/net/wireless/intel/iwlwifi/pcie/drv.c:9:
drivers/net/wireless/intel/iwlwifi/pcie/drv.c: In function 'iwl_pci_find_dev_info':
>> include/linux/array_size.h:12:24: warning: overflow in conversion from 'long unsigned int' to 'int' changes value from '18446744073709551615' to '-1' [-Woverflow]
12 | #define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]) + __must_be_array(a))
| ^
drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1344:18: note: in expansion of macro 'ARRAY_SIZE'
1344 | for (i = ARRAY_SIZE(iwl_dev_info_table) - 1; i >= 0; i--) {
| ^~~~~~~~~~


vim +12 include/linux/array_size.h

6
7
8 /**
9 * ARRAY_SIZE - get the number of elements in array @a
10 * @a: array to be sized
11 */
> 12 #define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]) + __must_be_array(a))
13
14

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

Attachment: .config.gz
Description: application/gzip