mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, opendmb@gmail.com,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] net: phy: Improved phy_error() with function and error code
Date: Wed, 22 Mar 2023 09:00:02 -0700	[thread overview]
Message-ID: <95ee76d7-7668-43b2-29e8-aab8a4281ab5@gmail.com> (raw)
In-Reply-To: <20230321214124.19f29406@kernel.org>



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

      reply	other threads:[~2023-03-22 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 21:34 Florian Fainelli
2023-03-22  4:41 ` Jakub Kicinski
2023-03-22 16:00   ` Florian Fainelli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95ee76d7-7668-43b2-29e8-aab8a4281ab5@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=opendmb@gmail.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®