diff mbox series

[u-boot,v4,32/36] ata: ahci: fix ahci_link_up() type mismatch for LTO

Message ID 20210520112425.25166-33-marek.behun@nic.cz
State Accepted
Commit 2361b5eb5c3e116519518848fe8db9aed4841f4a
Delegated to: Tom Rini
Headers show
Series U-Boot LTO (Sandbox + Some ARM boards) | expand

Commit Message

Marek Behún May 20, 2021, 11:24 a.m. UTC
When building highbank_defconfig with LTO, the compiler complains about
type mismatch of function ahci_link_up().

The third parameter of this function is of type u8 in
drivers/ata/ahci.c, but of type int in board/highbank/ahci.c.

There is no reason in using u8, and the code using this function
actually passes an int variable into the function (so it is implicitly
converted to u8).

Change the type of this parameter to int in drivers/ata/ahci.c.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
 drivers/ata/ahci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini May 25, 2021, 12:57 a.m. UTC | #1
On Thu, May 20, 2021 at 01:24:21PM +0200, Marek Behún wrote:

> When building highbank_defconfig with LTO, the compiler complains about
> type mismatch of function ahci_link_up().
> 
> The third parameter of this function is of type u8 in
> drivers/ata/ahci.c, but of type int in board/highbank/ahci.c.
> 
> There is no reason in using u8, and the code using this function
> actually passes an int variable into the function (so it is implicitly
> converted to u8).
> 
> Change the type of this parameter to int in drivers/ata/ahci.c.
> 
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 57c4e153ba..d4047c04f5 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -110,7 +110,7 @@  static int waiting_for_cmd_completed(void __iomem *offset,
 	return (i < timeout_msec) ? 0 : -1;
 }
 
-int __weak ahci_link_up(struct ahci_uc_priv *uc_priv, u8 port)
+int __weak ahci_link_up(struct ahci_uc_priv *uc_priv, int port)
 {
 	u32 tmp;
 	int j = 0;