[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <95ee76d7-7668-43b2-29e8-aab8a4281ab5@gmail.com>
Date: Wed, 22 Mar 2023 09:00:02 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, opendmb@...il.com,
Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] net: phy: Improved phy_error() with function and
error code
On 3/21/2023 9:41 PM, Jakub Kicinski wrote:
> On Mon, 20 Mar 2023 14:34:51 -0700 Florian Fainelli wrote:
>> +static inline void phy_error(struct phy_device *phydev)
>> +{
>> + phy_error_precise(phydev, (const void *)_RET_IP_, -EIO);
>> +}
>
> LGTM apart from this _RET_IP_ here. Wouldn't this make @func
> sometimes the function that returned the error and sometimes
> the caller? The caller is in the stack trace already, so no
> need to duplicate. Besides how dependable is using _RET_IP_
> inside a static inline?
You have a point that the existing phy_error() already has a WARN_ON()
that will tell us which function it has been invoked from whenever
phy_error() is used outside of the phy_state_machine(), expect a v2 shortly.
--
Florian
Powered by blists - more mailing lists