[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180529103536.obpsftgvt3s7lle5@mwanda>
Date: Tue, 29 May 2018 13:35:36 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Petr Machata <petrm@...lanox.com>
Cc: netdev@...r.kernel.org, devel@...verdev.osuosl.org,
bridge@...ts.linux-foundation.org, f.fainelli@...il.com,
andrew@...n.ch, nikolay@...ulusnetworks.com,
gregkh@...uxfoundation.org, vivien.didelot@...oirfairelinux.com,
idosch@...lanox.com, jiri@...lanox.com, razvan.stefanescu@....com,
davem@...emloft.net
Subject: Re: [PATCH net-next v3 1/7] net: bridge: Extract boilerplate around
switchdev_port_obj_*()
On Mon, May 28, 2018 at 05:10:28PM +0200, Petr Machata wrote:
> /* Try switchdev op first. In case it is not supported, fallback to
> * 8021q add.
> */
> - err = switchdev_port_obj_add(dev, &v.obj);
> + int err = br_switchdev_port_vlan_add(dev, vid, flags);
> if (err == -EOPNOTSUPP)
This will introduce a checkpatch warning if you re-run with the --file
option. (I haven't tested). It's sort of ugly to put function logic in
the declaration block. That's really just for initializing variables
like "int start = 0; struct foo *p = parent_of_bar();" Do it like this
instead:
int err;
err = br_switchdev_port_vlan_add(dev, vid, flags);
if (err == -EOPNOTSUPP)
regards,
dan carpenter
Powered by blists - more mailing lists