linux/arch
Gustavo A. R. Silva 13ae3f2fd2 MIPS: dec: prom: Address -Warray-bounds warning
[ Upstream commit 7b191b9b55 ]

Zero-length arrays are deprecated, and we are replacing them with flexible
array members instead. So, replace zero-length array with flexible-array
member in struct memmap.

Address the following warning found after building (with GCC-13) mips64
with decstation_64_defconfig:
In function 'rex_setup_memory_region',
    inlined from 'prom_meminit' at arch/mips/dec/prom/memory.c:91:3:
arch/mips/dec/prom/memory.c:72:31: error: array subscript i is outside array bounds of 'unsigned char[0]' [-Werror=array-bounds=]
   72 |                 if (bm->bitmap[i] == 0xff)
      |                     ~~~~~~~~~~^~~
In file included from arch/mips/dec/prom/memory.c:16:
./arch/mips/include/asm/dec/prom.h: In function 'prom_meminit':
./arch/mips/include/asm/dec/prom.h:73:23: note: while referencing 'bitmap'
   73 |         unsigned char bitmap[0];

This helps with the ongoing efforts to globally enable -Warray-bounds.

This results in no differences in binary output.

Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/323
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2023-07-27 08:46:58 +02:00
..
alpha alpha: fix R_ALPHA_LITERAL reloc for large modules 2023-03-17 08:49:01 +01:00
arc ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-23 13:47:15 +02:00
arm ARM: orion5x: fix d2net gpio initialization 2023-07-23 13:47:36 +02:00
arm64 arm64: errata: Add detection for TRBE overwrite in FILL mode 2023-07-23 13:47:48 +02:00
csky kprobes: treewide: Cleanup the error messages for kprobes 2023-02-22 12:57:00 +01:00
h8300 h8300: Fix build errors from do_exit() to make_task_dead() transition 2023-02-01 08:27:21 +01:00
hexagon hexagon: Fix function name in die() 2023-02-01 08:27:20 +01:00
ia64 ia64: fix an addr to taddr in huge_pte_offset() 2023-05-11 23:00:39 +09:00
m68k m68k: Move signal frame following exception on 68020/030 2023-05-30 13:55:30 +01:00
microblaze exit: Add and use make_task_dead. 2023-02-01 08:27:20 +01:00
mips MIPS: dec: prom: Address -Warray-bounds warning 2023-07-27 08:46:58 +02:00
nds32 exit: Add and use make_task_dead. 2023-02-01 08:27:20 +01:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 15:59:14 +02:00
openrisc openrisc: Properly store r31 to pt_regs on unhandled exceptions 2023-05-11 23:00:37 +09:00
parisc parisc: Delete redundant register definitions in <asm/assembly.h> 2023-07-05 18:25:05 +01:00
powerpc powerpc/security: Fix Speculation_Store_Bypass reporting on Power10 2023-07-23 13:47:47 +02:00
riscv riscv: mm: fix truncation warning on RV32 2023-07-23 13:47:45 +02:00
s390 s390/decompressor: fix misaligned symbol build error 2023-07-23 13:47:55 +02:00
sh sh: dma: Fix DMA channel offset calculation 2023-07-23 13:47:30 +02:00
sparc sparc: allow PM configs for sparc32 COMPILE_TEST 2023-03-10 09:39:33 +01:00
um um: Use HOST_DIR for mrproper 2023-07-23 13:47:33 +02:00
x86 x86/cpu/amd: Add a Zenbleed fix 2023-07-24 19:08:20 +02:00
xtensa xtensa: ISS: fix call to split_if_spec 2023-07-23 13:47:56 +02:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic 2022-08-17 14:23:00 +02:00