netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	linux-usb@vger.kernel.org
Cc: "Bjørn Mork" <bjorn@mork.no>,
	"David S. Miller" <davem@davemloft.net>,
	"Greg Ungerer" <gerg@linux-m68k.org>,
	"Liu Junliang" <liujunliang_ljl@163.com>,
	"Philippe Reynes" <tremyfr@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] sr9800: Use common error handling code in sr9800_phy_powerup()
Date: Sun, 29 Oct 2017 13:03:41 +0100	[thread overview]
Message-ID: <0600e4f9-dd53-158c-556b-8a87dfc928e6@users.sourceforge.net> (raw)
In-Reply-To: <CAMuHMdU6K+KPZvsStfwPev9Z5v1RRYAwLr04FHjmeC=VUEMC+Q@mail.gmail.com>

>> @@ -700,10 +700,9 @@ static int sr9800_phy_powerup(struct usbnet *dev)
>>
>>         /* set the embedded Ethernet PHY in power-up state */
>>         ret = sr_sw_reset(dev, SR_SWRESET_IPRL);
>> -       if (ret < 0) {
>> -               netdev_err(dev->net, "Failed to reset PHY: %d\n", ret);
>> -               return ret;
>> -       }
>> +       if (ret < 0)
>> +               goto report_reset_failure;
> 
> So now I have to look below to see what error handling it does...

Yes. - Can this be an usual consequence if you apply information from
the section “7) Centralized exiting of functions” in the document
“coding-style.rst” a bit more?



> Hence I prefer the original version, which had _less_ lines of code...

My update suggestion is only one line “bigger” in this case, isn't it?

I propose an other source code layout so that a bit smaller executable
object code could be achieved.
Do find such a software design direction feasible?

Regards,
Markus

  reply	other threads:[~2017-10-29 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-29 10:45 [PATCH] sr9800: Use common error handling code in sr9800_phy_powerup() SF Markus Elfring
2017-10-29 11:06 ` Geert Uytterhoeven
2017-10-29 12:03   ` SF Markus Elfring [this message]
2017-10-30  9:59     ` Geert Uytterhoeven
2017-11-04 15:03       ` SF 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=0600e4f9-dd53-158c-556b-8a87dfc928e6@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=bjorn@mork.no \
    --cc=davem@davemloft.net \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=liujunliang_ljl@163.com \
    --cc=netdev@vger.kernel.org \
    --cc=tremyfr@gmail.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).