]> git.baikalelectronics.ru Git - uboot.git/commit
x86: sizeof-array-div error in lpc_common_early_init
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 20 Feb 2021 09:05:24 +0000 (10:05 +0100)
committerBin Meng <bmeng.cn@gmail.com>
Tue, 9 Mar 2021 01:42:12 +0000 (09:42 +0800)
commitf3ce46f5be755ceb5c4d4cd0aaa4511e714185c7
tree592951956700e9725a130f13fc8bc790caa71ea3
parentcff42bef7f8e6f1cc7c1e55506578809bd7ccbaf
x86: sizeof-array-div error in lpc_common_early_init

Building qemu-x86_64_defconfig with GCC 11.0 fails with:

arch/x86/cpu/intel_common/lpc.c:
In function ‘lpc_common_early_init’:
arch/x86/cpu/intel_common/lpc.c:56:40:
error: expression does not compute the number of elements in this array;
element type is ‘struct reg_info’, not ‘u32’ {aka ‘unsigned int’}
[-Werror=sizeof-array-div]
   56 |                         sizeof(values) / sizeof(u32));
      |                                        ^
arch/x86/cpu/intel_common/lpc.c:56:40: note: add parentheses around the
second ‘sizeof’ to silence this warning
arch/x86/cpu/intel_common/lpc.c:50:11: note: array ‘values’ declared here
   50 |         } values[4], *ptr;
      |           ^~~~~~

Add parentheses to silence warning.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/intel_common/lpc.c