From: Andrew Lunn <andrew@lunn.ch>
To: sean.wang@mediatek.com
Cc: davem@davemloft.net, f.fainelli@gmail.com,
vivien.didelot@savoirfairelinux.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next 1/3] net: dsa: mediatek: add VLAN support for MT7530
Date: Thu, 7 Dec 2017 16:24:15 +0100 [thread overview]
Message-ID: <20171207152415.GB24750@lunn.ch> (raw)
In-Reply-To: <792c2d52b8da717b55ead9d480863ca390fe91b3.1512625814.git.sean.wang@mediatek.com>
> static void
> +mt7530_port_set_vlan_unware(struct dsa_switch *ds, int port)
> +{
> + struct mt7530_priv *priv = ds->priv;
> + int i;
> + bool all_user_ports_removed = true;
Hi Sean
Reverse Christmas tree please.
> +static int
> +mt7530_vlan_cmd(struct mt7530_priv *priv, enum mt7530_vlan_cmd cmd, u16 vid)
> +{
> + u32 val;
> + int ret;
> + struct mt7530_dummy_poll p;
Here too.
> +static int
> +mt7530_port_vlan_prepare(struct dsa_switch *ds, int port,
> + const struct switchdev_obj_port_vlan *vlan,
> + struct switchdev_trans *trans)
> +{
> + struct mt7530_priv *priv = ds->priv;
> +
> + /* The port is being kept as VLAN-unware port when bridge is set up
> + * with vlan_filtering not being set, Otherwise, the port and the
> + * corresponding CPU port is required the setup for becoming a
> + * VLAN-ware port.
> + */
> + if (!priv->ports[port].vlan_filtering)
> + return 0;
> +
> + mt7530_port_set_vlan_ware(ds, port);
> + mt7530_port_set_vlan_ware(ds, MT7530_CPU_PORT);
A prepare function should just validate that it is possible to carry
out the operation. It should not change any state. These two last
lines probably don't belong here.
> +
> + return 0;
> +}
> +
> +static void
> +mt7530_hw_vlan_add(struct mt7530_priv *priv,
> + struct mt7530_hw_vlan_entry *entry)
> +{
> + u32 val;
> + u8 new_members;
Reverse Christmas tree. Please check the whole patch.
> +static inline void INIT_MT7530_HW_ENTRY(struct mt7530_hw_vlan_entry *e,
> + int port, bool untagged)
> +{
> + e->port = port;
> + e->untagged = untagged;
> +}
All CAPITAL letters is for #defines. This is just a normal
function. Please use lower case.
Andrew
next prev parent reply other threads:[~2017-12-07 15:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 6:06 [PATCH net-next 0/3] add VLAN support to DSA MT7530 sean.wang
2017-12-07 6:06 ` [PATCH net-next 1/3] net: dsa: mediatek: add VLAN support for MT7530 sean.wang
2017-12-07 15:24 ` Andrew Lunn [this message]
[not found] ` <20171207152415.GB24750-g2DYL2Zd6BY@public.gmane.org>
2017-12-12 6:52 ` Sean Wang
2017-12-12 8:24 ` Felix Fietkau
2017-12-12 8:36 ` Sean Wang
2017-12-07 6:06 ` [PATCH net-next 2/3] net: dsa: mediatek: combine MediaTek tag with VLAN tag sean.wang
2017-12-07 15:30 ` Andrew Lunn
2017-12-12 7:21 ` Sean Wang
2017-12-12 8:28 ` Andrew Lunn
2017-12-12 8:40 ` Sean Wang
[not found] ` <cover.1512625814.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-12-07 6:06 ` [PATCH net-next 3/3] net: dsa: mediatek: update MAINTAINERS entry with MediaTek switch driver sean.wang-NuS5LvNUpcJWk0Htik3J/w
2017-12-07 15:31 ` Andrew Lunn
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=20171207152415.GB24750@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=sean.wang@mediatek.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;
as well as URLs for NNTP newsgroup(s).