From: Stephen Hemminger <stephen@networkplumber.org>
To: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
roopa@cumulusnetworks.com, bridge@lists.linux-foundation.org,
davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
Date: Mon, 26 Nov 2018 09:39:23 -0800 [thread overview]
Message-ID: <20181126093923.74c50dcb@xeon-e3> (raw)
In-Reply-To: <bc90dc53-b4fc-3725-7141-556e62f027f8@cumulusnetworks.com>
On Sun, 25 Nov 2018 10:12:45 +0200
Nikolay Aleksandrov <nikolay@cumulusnetworks.com> wrote:
> On 24/11/2018 18:46, nikolay@cumulusnetworks.com wrote:
> > On 24 November 2018 18:25:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
> >> On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@cumulusnetworks.com
> >> wrote:
> >>> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
> >>>>> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id
> >> opt,
> >>>> bool on,
> >>>>> + struct netlink_ext_ack *extack)
> >>>>> +{
> >>>>> + switch (opt) {
> >>>>> + default:
> >>>>> + /* shouldn't be called with unsupported options */
> >>>>> + WARN_ON(1);
> >>>>> + break;
> >>>>
> >>>> So you return 0 here, meaning the br_debug() lower down will not
> >>>> happen. Maybe return -EOPNOTSUPP?
> >>>>
> >>>
> >>> No, the idea here is that some option in the future might return an
> >> error.
> >>> This function cannot be called with unsupported option thus the warn.
>
Please don't implement some part of the API until it is used (YAGNI).
If do this kind of "someday will come" design the code will end up
littered with dead ends.
next prev parent reply other threads:[~2018-11-26 17:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-24 2:34 [Bridge] [PATCH net-next v2 0/3] net: bridge: add an option to disabe linklocal learning Nikolay Aleksandrov
2018-11-24 2:34 ` [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options Nikolay Aleksandrov
2018-11-24 16:10 ` Andrew Lunn
2018-11-24 16:18 ` nikolay
2018-11-24 16:25 ` Andrew Lunn
2018-11-24 16:46 ` nikolay
2018-11-25 8:12 ` Nikolay Aleksandrov
2018-11-26 17:39 ` Stephen Hemminger [this message]
2018-11-26 17:41 ` Nikolay Aleksandrov
2018-11-25 15:45 ` Andrew Lunn
2018-11-24 2:34 ` [Bridge] [PATCH net-next v2 2/3] net: bridge: add no_linklocal_learn bool option Nikolay Aleksandrov
2018-11-24 16:27 ` Andrew Lunn
2018-11-24 2:34 ` [Bridge] [PATCH net-next v2 3/3] net: bridge: export supported boolopts Nikolay Aleksandrov
2018-11-24 16:16 ` Andrew Lunn
2018-11-24 16:20 ` nikolay
2018-11-24 16:26 ` Andrew Lunn
2018-11-27 23:04 ` [Bridge] [PATCH net-next v2 0/3] net: bridge: add an option to disabe linklocal learning David Miller
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=20181126093923.74c50dcb@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=andrew@lunn.ch \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=roopa@cumulusnetworks.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