public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Jiri Pirko <jiri@resnulli.us>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Markus Elfring <Markus.Elfring@web.de>,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Madalin Bucur <madalin.bucur@nxp.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Sean Anderson <sean.anderson@seco.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: fman: Use common error handling code in dtsec_init()
Date: Wed, 28 Feb 2024 17:59:31 +0300	[thread overview]
Message-ID: <8e3b3338-d2f9-44ac-bcf6-e53ccc3c9cb2@moroto.mountain> (raw)
In-Reply-To: <Zd7mFe3-kbqjGpxh@nanopsycho>

On Wed, Feb 28, 2024 at 08:51:49AM +0100, Jiri Pirko wrote:
> Wed, Feb 28, 2024 at 03:46:57AM CET, kuba@kernel.org wrote:
> >On Tue, 27 Feb 2024 14:14:52 +0100 Markus Elfring wrote:
> >> Adjust jump targets so that a bit of exception handling can be better
> >> reused at the end of this function implementation.
> >
> >Okay, but..
> >
> >>  .../net/ethernet/freescale/fman/fman_dtsec.c  | 19 +++++++++++--------
> >>  1 file changed, 11 insertions(+), 8 deletions(-)
> >
> >..you've added more lines than you've removed so what's the point.
> 
> To have cleaner error path? Not always lines of code is the correct
> indicator of patch quality :)
> 

I really don't like those goto e_nomem type of things.  When you're
laddering gotos you should do that kind of thing before the gotos so
that when people add new gotos it doesn't make a mess.  It's the same
for unlocks, do that before the goto unless it matches a lock at the
very start of the function.  Or if you're doing a goto from inside a
loop then clean up the partial iteration through the loop before the
goto.

regards,
dan carpenter


  reply	other threads:[~2024-02-28 14:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 13:14 [PATCH] net: fman: Use common error handling code in dtsec_init() Markus Elfring
2024-02-27 13:54 ` Madalin Bucur (OSS)
2024-02-27 15:42 ` Jiri Pirko
2024-02-28  2:46 ` Jakub Kicinski
2024-02-28  7:51   ` Jiri Pirko
2024-02-28 14:59     ` Dan Carpenter [this message]
2024-02-28  8:43   ` Markus Elfring

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=8e3b3338-d2f9-44ac-bcf6-e53ccc3c9cb2@moroto.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=Markus.Elfring@web.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiri@resnulli.us \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sean.anderson@seco.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