public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jarod Wilson <jarod@redhat•com>
To: 张胜举 <zhangshengju@cmss•chinamobile.com>
Cc: j.vosburgh@gmail•com, netdev@vger•kernel.org
Subject: Re: Reply: [net] bonding: use return instead of goto
Date: Fri, 5 Feb 2016 16:24:39 -0500	[thread overview]
Message-ID: <20160205212438.GC63431@redhat.com> (raw)
In-Reply-To: <000301d15fb6$77bf08f0$673d1ad0$@cmss.chinamobile.com>

On Fri, Feb 05, 2016 at 09:42:24AM +0800, 张胜举 wrote:
> > On Wed, Feb 03, 2016 at 06:15:22AM +0000, Zhang Shengju wrote:
> > > Replace 'goto' with 'return' to remove unnecessary check at label:
> > > err_undo_flags.
> > 
> > I think you're going to have to explain how you came to the conclusion
> > that the check isn't necessary.
...
> The reason is that 'err_undo_flags' do two things for the first slave
> device:
> 1. revert bond mac address if it is set by the slave device.
> 2. revert bond device type if it's not ARPHRD_ETHER.
> 
> I think it's not necessary for the three places, they changed neither  bond
> mac address nor type. 
> it's straightforward to return directly.

I see what you're saying, and that does look to be true if you're only
adding a singular first device right now. But looking at the enslave and
release paths, I don't see anything preventing concurrent slave adds and
removes, which could mean there are situations where those checks really
are necessary. I don't actually know.

-- 
Jarod Wilson
jarod@redhat•com

  reply	other threads:[~2016-02-05 21:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05  1:42 Reply: [net] bonding: use return instead of goto 张胜举
2016-02-05 21:24 ` Jarod Wilson [this message]
2016-02-06 11:05   ` 张胜举

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=20160205212438.GC63431@redhat.com \
    --to=jarod@redhat$(echo .)com \
    --cc=j.vosburgh@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=zhangshengju@cmss$(echo .)chinamobile.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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