Netdev List
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Petr Machata <petrm@mellanox.com>
Cc: devel@driverdev.osuosl.org, andrew@lunn.ch, f.fainelli@gmail.com,
	vivien.didelot@savoirfairelinux.com, nikolay@cumulusnetworks.com,
	netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
	idosch@mellanox.com, jiri@mellanox.com,
	razvan.stefanescu@nxp.com, gregkh@linuxfoundation.org,
	davem@davemloft.net
Subject: Re: [PATCH net-next v3 1/7] net: bridge: Extract boilerplate around switchdev_port_obj_*()
Date: Tue, 29 May 2018 13:35:36 +0300	[thread overview]
Message-ID: <20180529103536.obpsftgvt3s7lle5@mwanda> (raw)
In-Reply-To: <85401f20b801fa1bae3025bf1df991a9d475fe85.1527519997.git.petrm@mellanox.com>

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

  reply	other threads:[~2018-05-29 10:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-28 15:10 [PATCH net-next v3 0/7] net: bridge: Notify about bridge VLANs Petr Machata
2018-05-28 15:10 ` [PATCH net-next v3 1/7] net: bridge: Extract boilerplate around switchdev_port_obj_*() Petr Machata
2018-05-29 10:35   ` Dan Carpenter [this message]
2018-05-29 12:42   ` Vivien Didelot
2018-05-28 15:10 ` [PATCH net-next v3 2/7] mlxsw: spectrum_switchdev: Ignore bridge VLAN events Petr Machata
2018-05-29 10:43   ` Dan Carpenter
2018-05-28 15:10 ` [PATCH net-next v3 3/7] rocker: rocker_main: " Petr Machata
2018-05-28 15:10 ` [PATCH net-next v3 4/7] dsa: port: " Petr Machata
2018-05-28 15:10 ` [PATCH net-next v3 5/7] staging: fsl-dpaa2: ethsw: " Petr Machata
2018-05-28 15:11 ` [PATCH net-next v3 6/7] net: bridge: Notify about bridge VLANs Petr Machata
2018-05-29 10:55   ` Dan Carpenter
2018-05-29 13:12     ` Petr Machata
2018-05-28 15:11 ` [PATCH net-next v3 7/7] mlxsw: spectrum_switchdev: Schedule respin during trans prepare Petr Machata
2018-05-29 10:46 ` [PATCH net-next v3 0/7] net: bridge: Notify about bridge VLANs Dan Carpenter
2018-05-29 10:58   ` Ido Schimmel
2018-05-29 11:02     ` Dan Carpenter

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=20180529103536.obpsftgvt3s7lle5@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=andrew@lunn.ch \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=petrm@mellanox.com \
    --cc=razvan.stefanescu@nxp.com \
    --cc=vivien.didelot@savoirfairelinux.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