[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a16c5e5b-8431-4948-ad72-379375dba096@lunn.ch>
Date: Sat, 3 Jan 2026 19:13:59 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Alok Tiwari <alok.a.tiwari@...cle.com>
Cc: vadym.kochan@...ision.eu, oleksandr.mazur@...ision.eu,
andrew+netdev@...n.ch, taras.chornyi@...ision.eu, kuba@...nel.org,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
horms@...nel.org, netdev@...r.kernel.org,
alok.a.tiwarilinux@...il.com
Subject: Re: [PATCH net-next] net: marvell: prestera: correct return type of
prestera_ldr_wait_buf()
On Sat, Jan 03, 2026 at 09:43:10AM -0800, Alok Tiwari wrote:
> prestera_ldr_wait_buf() returns the result of readl_poll_timeout(),
> which is 0 on success or -ETIMEDOUT on failure. Its current return
> type is u32.
>
> Assigning this u32 value to an int variable works today because the
> bit pattern of (u32)-ETIMEDOUT (0xffffff92) is correctly interpreted
> as -ETIMEDOUT when stored in an int. However, keeping the function
> return type as u32 is misleading and fragile.
>
> Change the return type to int to reflect the actual semantic of
> returning negative error codes and to avoid potential issues with
> unsigned casts. There is no functional change.
>
> Signed-off-by: Alok Tiwari <alok.a.tiwari@...cle.com>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
Powered by blists - more mailing lists