[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202306030807.GiXzVRcZ-lkp@intel.com>
Date: Sat, 3 Jun 2023 08:54:01 +0800
From: kernel test robot <lkp@...el.com>
To: "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: oe-kbuild-all@...ts.linux.dev,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: [gustavoars:testing/fam01-next20230602 7/7]
fs/jffs2/nodelist.h:43:28: warning: array subscript 'union jffs2_sum_mem[0]'
is partly outside array bounds of 'unsigned char[26]'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/fam01-next20230602
head: 20aaaa40b39f5178aee00e3982b68ab8fd0c59a8
commit: 20aaaa40b39f5178aee00e3982b68ab8fd0c59a8 [7/7] Makefile: Enable -Warray-bounds
config: x86_64-buildonly-randconfig-r003-20230531 (https://download.01.org/0day-ci/archive/20230603/202306030807.GiXzVRcZ-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=20aaaa40b39f5178aee00e3982b68ab8fd0c59a8
git remote add gustavoars https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
git fetch --no-tags gustavoars testing/fam01-next20230602
git checkout 20aaaa40b39f5178aee00e3982b68ab8fd0c59a8
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/clocksource/ drivers/mmc/host/ drivers/soc/qcom/ drivers/spi/ fs/jffs2/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306030807.GiXzVRcZ-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from fs/jffs2/summary.c:23:
In function 'jffs2_sum_add_mem',
inlined from 'jffs2_sum_add_inode_mem' at fs/jffs2/summary.c:130:9:
>> fs/jffs2/nodelist.h:43:28: warning: array subscript 'union jffs2_sum_mem[0]' is partly outside array bounds of 'unsigned char[26]' [-Warray-bounds]
43 | #define je16_to_cpu(x) ((x).v16)
| ~~~~^~~~~
fs/jffs2/summary.c:71:17: note: in expansion of macro 'je16_to_cpu'
71 | switch (je16_to_cpu(item->u.nodetype)) {
| ^~~~~~~~~~~
In file included from fs/jffs2/summary.c:17:
In function 'kmalloc',
inlined from 'jffs2_sum_add_inode_mem' at fs/jffs2/summary.c:118:37:
include/linux/slab.h:559:24: note: object of size 26 allocated by 'kmalloc_trace'
559 | return kmalloc_trace(
| ^~~~~~~~~~~~~~
560 | kmalloc_caches[kmalloc_type(flags)][index],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
561 | flags, size);
| ~~~~~~~~~~~~
In file included from fs/jffs2/nodelist.h:22:
In function 'jffs2_sum_add_mem',
inlined from 'jffs2_sum_add_inode_mem' at fs/jffs2/summary.c:130:9:
>> fs/jffs2/summary.c:79:73: warning: array subscript 'union jffs2_sum_mem[0]' is partly outside array bounds of 'unsigned char[26]' [-Warray-bounds]
79 | s->sum_size += JFFS2_SUMMARY_DIRENT_SIZE(item->d.nsize);
fs/jffs2/summary.h:34:80: note: in definition of macro 'JFFS2_SUMMARY_DIRENT_SIZE'
34 | #define JFFS2_SUMMARY_DIRENT_SIZE(x) (sizeof(struct jffs2_sum_dirent_flash) + (x))
| ^
In function 'kmalloc',
inlined from 'jffs2_sum_add_inode_mem' at fs/jffs2/summary.c:118:37:
include/linux/slab.h:559:24: note: object of size 26 allocated by 'kmalloc_trace'
559 | return kmalloc_trace(
| ^~~~~~~~~~~~~~
560 | kmalloc_caches[kmalloc_type(flags)][index],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
561 | flags, size);
| ~~~~~~~~~~~~
--
drivers/spi/spi-imx.c: In function 'spi_imx_probe':
>> drivers/spi/spi-imx.c:1705:34: warning: array subscript 0 is outside array bounds of 'const bool[0]' {aka 'const _Bool[]'} [-Warray-bounds]
1705 | slave_mode = devtype_data->has_slavemode &&
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~
--
In file included from include/linux/clocksource.h:22,
from include/linux/clockchips.h:14,
from drivers/clocksource/timer-tegra.c:12:
In function '__writel',
inlined from 'tegra_timer_resume' at drivers/clocksource/timer-tegra.c:113:2:
>> arch/x86/include/asm/io.h:56:3: warning: array subscript 0 is outside array bounds of 'void[0]' [-Warray-bounds]
56 | { asm volatile("mov" size " %0,%1": :reg (val), \
| ^~~
arch/x86/include/asm/io.h:73:1: note: in expansion of macro 'build_mmio_write'
73 | build_mmio_write(__writel, "l", unsigned int, "r", )
| ^~~~~~~~~~~~~~~~
--
drivers/soc/qcom/llcc-qcom.c: In function 'qcom_llcc_probe':
>> drivers/soc/qcom/llcc-qcom.c:1039:17: warning: array subscript 0 is outside array bounds of 'const bool[0]' {aka 'const _Bool[]'} [-Warray-bounds]
1039 | if (!cfg->no_edac) {
| ~~~^~~~~~~~~
--
drivers/mmc/host/sdhci-msm.c: In function 'sdhci_msm_probe':
>> drivers/mmc/host/sdhci-msm.c:2557:48: warning: array subscript 0 is outside array bounds of 'const bool[0]' {aka 'const _Bool[]'} [-Warray-bounds]
2557 | msm_host->restore_dll_config = var_info->restore_dll_config;
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
vim +43 fs/jffs2/nodelist.h
566865a2a4791c David Woodhouse 2007-04-23 42
^1da177e4c3f41 Linus Torvalds 2005-04-16 @43 #define je16_to_cpu(x) ((x).v16)
^1da177e4c3f41 Linus Torvalds 2005-04-16 44 #define je32_to_cpu(x) ((x).v32)
^1da177e4c3f41 Linus Torvalds 2005-04-16 45 #define jemode_to_cpu(x) (jffs2_to_os_mode((x).m))
^1da177e4c3f41 Linus Torvalds 2005-04-16 46 #elif defined(JFFS2_BIG_ENDIAN)
^1da177e4c3f41 Linus Torvalds 2005-04-16 47 #define cpu_to_je16(x) ((jint16_t){cpu_to_be16(x)})
^1da177e4c3f41 Linus Torvalds 2005-04-16 48 #define cpu_to_je32(x) ((jint32_t){cpu_to_be32(x)})
^1da177e4c3f41 Linus Torvalds 2005-04-16 49 #define cpu_to_jemode(x) ((jmode_t){cpu_to_be32(os_to_jffs2_mode(x))})
^1da177e4c3f41 Linus Torvalds 2005-04-16 50
:::::: The code at line 43 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@...970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@...970.osdl.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists