From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Mon, 8 Mar 2021 14:50:29 +0800 Subject: [PATCH u-boot-marvell 01/39] ddr: marvell: axp: align signature of mv_xor_mem_init() with a38x In-Reply-To: <20210307042538.21229-2-marek.behun@nic.cz> References: <20210307042538.21229-1-marek.behun@nic.cz> <20210307042538.21229-2-marek.behun@nic.cz> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sun, Mar 7, 2021 at 12:26 PM Marek Beh?n wrote: > > In arch/arm/mach-mvebu/dram.c we always include axp's xor.h for common > XOR definitions, regardless whether we compile for axp or a38x. > > But the declaration of this function has a different signature in axp's > xor.h from the one used in a38x' implementation - one parameter is u64 > instead of u32. This can result in wrong argument's being passed to that > function on a38x with no one the wiser. > > I discovered this when building U-Boot for Turris Omnia with LTO. The > compiler complains about the different signatures being thrown into the > same linking process: > > axp/xor.h:67:5: warning: type of ?mv_xor_mem_init? does not match > original declaration [-Wlto-type-mismatch] > 67 | int mv_xor_mem_init(u32 chan, u32 start_ptr, u32 block_size, > | ^ > a38x/xor.c:165:5: note: type mismatch in parameter 3 > 165 | int mv_xor_mem_init(u32 chan, u32 start_ptr, unsigned long long > | ^ > a38x/xor.c:165:5: note: type ?long long unsigned int? should match > type ?u32? > > Fix this by changing the type of the block_size argument in the axp's > implementation and header file to the one used in a38x (and upstream > mv-ddr-marvell). > > Signed-off-by: Marek Beh?n > Reviewed-by: Stefan Roese > --- > drivers/ddr/marvell/axp/xor.c | 4 ++-- > drivers/ddr/marvell/axp/xor.h | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > Reviewed-by: Bin Meng