linux-brain/arch/ia64/kernel
Arnd Bergmann 51fd1f6836 ia64: mca_drv: fix incorrect array size calculation
[ Upstream commit c5f320ff8a79501bb59338278336ec43acb9d7e2 ]

gcc points out a mistake in the mca driver that goes back to before the
git history:

arch/ia64/kernel/mca_drv.c: In function 'init_record_index_pools':
arch/ia64/kernel/mca_drv.c:346:54: error: expression does not compute the number of elements in this array; element typ
e is 'int', not 'size_t' {aka 'long unsigned int'} [-Werror=sizeof-array-div]
  346 |         for (i = 1; i < sizeof sal_log_sect_min_sizes/sizeof(size_t); i++)
      |                                                      ^

This is the same as sizeof(size_t), which is two shorter than the actual
array.  Use the ARRAY_SIZE() macro to get the correct calculation instead.

Link: https://lkml.kernel.org/r/20210514214123.875971-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:53:19 +02:00
..
syscalls arch: mark syscall number 435 reserved for clone3 2019-07-15 00:39:33 +02:00
.gitignore [IA64] Cleanup generated file not ignored by .gitignore 2008-08-04 11:06:16 -07:00
Makefile ia64: fix build error with !COREDUMP 2020-11-05 11:43:33 +01:00
Makefile.gate ia64: require -Wl,--hash-style=sysv 2019-05-18 11:29:01 +09:00
acpi-ext.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
acpi.c ia64: remove support for machvecs 2019-08-16 14:32:26 -07:00
asm-offsets.c pid: Implement PIDTYPE_TGID 2018-07-21 10:43:12 -05:00
audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
brl_emu.c signal: Remove the task parameter from force_sig_fault 2019-05-29 09:31:43 -05:00
crash.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
crash_dump.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cyclone.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dma-mapping.c ia64: remove CONFIG_SWIOTLB ifdefs 2019-08-16 14:32:26 -07:00
efi.c efi: ia64: move SAL systab handling out of generic EFI code 2019-08-08 11:01:48 +03:00
efi_stub.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
elfcore.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
entry.S ia64: generate uapi header and system call table files 2018-11-13 08:56:25 -08:00
entry.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
err_inject.c ia64: fix format strings for err_inject 2021-04-10 13:34:31 +02:00
esi.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
esi_stub.S treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
fsys.S docs: ia64: convert to ReST 2019-07-15 09:20:25 -03:00
fsyscall_gtod_data.h Stop ia64 being the last holdout using GENERIC_TIME_VSYSCALL_OLD 2017-11-13 12:15:40 -08:00
ftrace.c ia64: ftrace: Fix the comments for ftrace_modify_code() 2015-12-23 14:27:23 -05:00
gate-data.S Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
gate.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gate.lds.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
head.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ia64_ksyms.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
iosapic.c ia64: remove support for machvecs 2019-08-16 14:32:26 -07:00
irq.c ia64: remove now unused machvec indirections 2019-08-16 11:33:57 -07:00
irq_ia64.c ia64: Fix some warnings introduced in merge window 2019-09-24 12:29:16 -07:00
irq_lsapic.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ivt.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kprobes.c ia64: kprobes: Use generic kretprobe trampoline handler 2020-11-05 11:43:16 +01:00
machine_kexec.c ia64: remove now unused machvec indirections 2019-08-16 11:33:57 -07:00
mca.c ia64: mca: allocate early mca with GFP_ATOMIC 2021-04-10 13:34:31 +02:00
mca_asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mca_drv.c ia64: mca_drv: fix incorrect array size calculation 2021-07-14 16:53:19 +02:00
mca_drv.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mca_drv_asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
minstate.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
module.c ia64: module: fix symbolizer crash on fdescr 2021-05-19 10:08:24 +02:00
msi_ia64.c ia64: remove now unused machvec indirections 2019-08-16 11:33:57 -07:00
nr-irqs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
numa.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pal.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
palinfo.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
patch.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci-dma.c ia64 for v5.4 - big change here is removal of support for SGI Altix 2019-09-16 15:32:01 -07:00
perfmon.c Merge branch 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-07-19 10:42:02 -07:00
perfmon_default_smpl.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
perfmon_generic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perfmon_itanium.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perfmon_mckinley.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perfmon_montecito.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
process.c ia64: do not use print_symbol() 2018-01-05 15:20:28 +01:00
ptrace.c ia64: fix ia64_syscall_get_set_arguments() for break-based syscalls 2021-03-30 14:35:23 +02:00
relocate_kernel.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 230 2019-06-19 17:09:06 +02:00
sal.c ia64: remove now unused machvec indirections 2019-08-16 11:33:57 -07:00
salinfo.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
setup.c dma-mapping updates for 5.4: 2019-09-19 13:27:23 -07:00
sigframe.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
signal.c ia64: annotate a switch fallthrough in ia64_do_signal 2019-08-12 09:52:36 -07:00
smp.c ia64: remove support for machvecs 2019-08-16 14:32:26 -07:00
smpboot.c ia64: remove support for machvecs 2019-08-16 14:32:26 -07:00
stacktrace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sys_ia64.c ia64: remove CONFIG_PCI ifdefs 2019-08-16 11:33:57 -07:00
time.c ia64: remove support for machvecs 2019-08-16 14:32:26 -07:00
topology.c ia64: remove CONFIG_ACPI ifdefs 2019-08-16 11:33:57 -07:00
traps.c signal: Remove the task parameter from force_sig_fault 2019-05-29 09:31:43 -05:00
unaligned.c ia64: annotate switch fallthroughs in ia64_handle_unaligned 2019-08-12 09:53:13 -07:00
uncached.c ia64: remove support for the SGI SN2 platform 2019-08-16 11:33:57 -07:00
unwind.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
unwind_decoder.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
unwind_i.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vmlinux.lds.S ia64: remove support for machvecs 2019-08-16 14:32:26 -07:00