]> git.baikalelectronics.ru Git - uboot.git/commit
ARM: imx: bootaux: Fix LTO -Wlto-type-mismatch
authorMarek Vasut <marex@denx.de>
Tue, 13 Dec 2022 04:46:07 +0000 (05:46 +0100)
committerStefano Babic <sbabic@denx.de>
Mon, 30 Jan 2023 22:23:02 +0000 (23:23 +0100)
commitdaf6dd06a8ad19c05a699f4f256e30af46e8abf1
treef41626caa46212922183981a395f3b8825130f93
parent632ab6cb84ebe05e1bf2ac224cb5f7a14f83d44d
ARM: imx: bootaux: Fix LTO -Wlto-type-mismatch

Commit 9d22a64ea09d ("imx: bootaux: cleanup code") introduces the
following LTO related warning:

"
arch/arm/mach-imx/imx_bootaux.c:24:31: warning: type of ‘hostmap’ does not match original declaration [-Wlto-type-mismatch]
   24 | const __weak struct rproc_att hostmap[] = { };
      |                               ^
arch/arm/mach-imx/imx8m/soc.c:1590:24: note: array types have different bounds
 1590 | const struct rproc_att hostmap[] = {
      |                        ^
arch/arm/mach-imx/imx8m/soc.c:1590:24: note: ‘hostmap’ was previously declared here
../aarch64-linux-gnu/bin/ld: warning: u-boot has a LOAD segment with RWX permissions
"

This is because the weak empty array of structures "hostmap" is eventually
replaced by non-empty array of structures with different number of elements.
Fix this by avoiding weak variable size array, instead use a weak function
which returns single pointer to the array.

Fixes: 9d22a64ea09d ("imx: bootaux: cleanup code")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
arch/arm/include/asm/mach-imx/sys_proto.h
arch/arm/mach-imx/imx8m/soc.c
arch/arm/mach-imx/imx_bootaux.c
arch/arm/mach-imx/mx7/soc.c