netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Yang Ruibin <11162571@vivo.com>,
	Lino Sanfilippo <LinoSanfilippo@gmx.de>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <opensource.kernel@vivo.com>
Subject: Re: [PATCH v1] net: alacritech: Switch to use dev_err_probe()
Date: Wed, 28 Aug 2024 15:11:33 -0700	[thread overview]
Message-ID: <c783be58-b983-45ab-b0ff-7deb38ee70b5@intel.com> (raw)
In-Reply-To: <20240828122650.1324246-1-11162571@vivo.com>


nit: subject should include "net-next" for changes like this which are
cleanups meant for the net-next tree.

On 8/28/2024 5:26 AM, Yang Ruibin wrote:x
> use dev_err_probe() instead of dev_err() to simplify the error path and
> standardize the format of the error code.
> 
> Signed-off-by: Yang Ruibin <11162571@vivo.com>
> ---
>  drivers/net/ethernet/alacritech/slicoss.c | 34 ++++++++++-------------
>  1 file changed, 14 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/net/ethernet/alacritech/slicoss.c b/drivers/net/ethernet/alacritech/slicoss.c
> index 78231c852..65919ace0 100644
> --- a/drivers/net/ethernet/alacritech/slicoss.c
> +++ b/drivers/net/ethernet/alacritech/slicoss.c
> @@ -1051,11 +1051,9 @@ static int slic_load_rcvseq_firmware(struct slic_device *sdev)
>  	file = (sdev->model == SLIC_MODEL_OASIS) ?  SLIC_RCV_FIRMWARE_OASIS :
>  						    SLIC_RCV_FIRMWARE_MOJAVE;
>  	err = request_firmware(&fw, file, &sdev->pdev->dev);
> -	if (err) {
> -		dev_err(&sdev->pdev->dev,
> +	if (err)
> +		return dev_err_probe(&sdev->pdev->dev, err,
>  			"failed to load receive sequencer firmware %s\n", file);

Nice. dev_err_probe also handles some specific behavior for
-EPROBE_DEFER, which isn't being used here. That's fine since the custom
logic only triggers specifically on -EPROBE_DEFER. It also has custom
handling to avoid logging an error message on -ENOMEM. Neat.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

  reply	other threads:[~2024-08-28 22:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 12:26 [PATCH v1] net: alacritech: Switch to use dev_err_probe() Yang Ruibin
2024-08-28 22:11 ` Jacob Keller [this message]
2024-08-29 19:00 ` patchwork-bot+netdevbpf
2024-08-30 16:54 ` Krzysztof Kozlowski

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=c783be58-b983-45ab-b0ff-7deb38ee70b5@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=11162571@vivo.com \
    --cc=LinoSanfilippo@gmx.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=opensource.kernel@vivo.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;
as well as URLs for NNTP newsgroup(s).