On Sun, 25 Nov 2018 10:12:45 +0200 Nikolay Aleksandrov <[email protected]> wrote:
> On 24/11/2018 18:46, [email protected] wrote: > > On 24 November 2018 18:25:41 EET, Andrew Lunn <[email protected]> wrote: > >> On Sat, Nov 24, 2018 at 06:18:33PM +0200, [email protected] > >> wrote: > >>> On 24 November 2018 18:10:41 EET, Andrew Lunn <[email protected]> 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.
