android_kernel_xiaomi_sm8350/arch/mips
Gustavo A. R. Silva 2225000d62 MIPS: dec: prom: Address -Warray-bounds warning
[ Upstream commit 7b191b9b55df2a844bd32d1d380f47a7df1c2896 ]

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>
2023-08-30 16:27:09 +02:00
..
alchemy MIPS: Alchemy: fix dbdma2 2023-06-21 15:44:09 +02:00
ar7
ath25
ath79
bcm47xx MIPS: BCM47XX: Cast memcmp() of function to (void *) 2022-10-26 13:22:47 +02:00
bcm63xx MIPS: BCM63xx: Add check for NULL for clk in clk_enable 2023-01-18 11:40:58 +01:00
bmips mips: bmips: BCM6358: disable RAC flush for TP1 2023-04-05 11:16:43 +02:00
boot mips: disable branch profiling in boot/decompress.o 2021-07-20 16:10:53 +02:00
cavium-octeon MIPS: OCTEON: warn only once if deprecated link status is being used 2023-01-18 11:40:58 +01:00
cobalt
configs Remove DECnet support from kernel 2023-06-21 15:44:10 +02:00
crypto
dec mips: DEC: honor CONFIG_MIPS_FP_SUPPORT=n 2022-04-15 14:18:15 +02:00
emma
fw MIPS: fw: Allow firmware to pass a empty env 2023-05-17 11:35:32 +02:00
generic MIPS: generic/yamon-dt: fix uninitialized variable error 2021-11-26 10:47:19 +01:00
include MIPS: dec: prom: Address -Warray-bounds warning 2023-08-30 16:27:09 +02:00
jazz dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
jz4740 MIPS: fix build with gcc-12 2022-05-18 09:47:28 +02:00
kernel mips/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:56:34 +02:00
kvm KVM: MIPS: Change the definition of kvm type 2020-09-23 12:40:38 +02:00
lantiq MIPS: vpe-mt: drop physical_memsize 2023-03-11 16:43:52 +01:00
lasat treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD() 2023-04-20 12:07:32 +02:00
lib treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
loongson32 MIPS: Loongson32: Fix PHY-mode being left unspecified 2022-09-28 11:04:06 +02:00
loongson64 MIPS: loongsoon64: Reserve memory below starting pfn to prevent Oops 2021-07-19 08:53:13 +02:00
math-emu
mm treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
mti-malta MIPS: Malta: fix alignment of the devicetree buffer 2021-09-22 12:26:26 +02:00
net bpf, mips: Validate conditional branch offsets 2021-10-13 10:08:17 +02:00
netlogic
oprofile
paravirt
pci MIPS: pci-legacy: stop using of_pci_range_to_resource 2021-05-14 09:44:30 +02:00
pic32 MIPS: pic32: treat port as signed integer 2022-12-08 11:22:57 +01:00
pistachio
pmcs-msp71xx
pnx833x
power
ralink MIPS: Use address-of operator on section symbols 2022-05-15 19:54:46 +02:00
rb532 MIPS: RB532: fix return value of __setup handler 2022-04-15 14:18:16 +02:00
sgi-ip22
sgi-ip27
sgi-ip32
sibyte
sni MIPS: sni: Fix the build 2021-11-26 10:47:16 +01:00
tools MIPS: tools: Fix resource leak in elf-entry.c 2020-06-22 09:31:08 +02:00
txx9
vdso MIPS: VDSO: Use CLANG_FLAGS instead of filtering out '--target=' 2021-03-07 12:20:41 +01:00
vr41xx MIPS: Remove repetitive increase irq_err_count 2022-06-29 08:58:46 +02:00
Kbuild
Kbuild.platforms
Kconfig mips/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:56:34 +02:00
Kconfig.debug
Makefile mips: Fix non-POSIX regexp 2021-08-12 13:20:57 +02:00
Makefile.postlink