[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <trinity-5fd6da8c-15f6-488d-a332-0ce7625f41e0-1650988498781@3c-app-gmx-bs69>
Date: Tue, 26 Apr 2022 17:54:58 +0200
From: Frank Wunderlich <frank-w@...lic-files.de>
To: Florian Fainelli <f.fainelli@...il.com>
Cc: Frank Wunderlich <linux@...web.de>,
linux-mediatek@...ts.infradead.org,
linux-rockchip@...ts.infradead.org,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Heiko Stuebner <heiko@...ech.de>,
Sean Wang <sean.wang@...iatek.com>,
Landen Chao <Landen.Chao@...iatek.com>,
DENG Qingfang <dqfext@...il.com>, Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Peter Geis <pgwipeout@...il.com>, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Aw: Re: [RFC v1 2/3] net: dsa: mt753x: make CPU-Port dynamic
Hi
thanks for fast review.
> Gesendet: Dienstag, 26. April 2022 um 17:45 Uhr
> Von: "Florian Fainelli" <f.fainelli@...il.com>
> On 4/26/22 06:49, Frank Wunderlich wrote:
> > From: Frank Wunderlich <frank-w@...lic-files.de>
> > @@ -1190,8 +1191,8 @@ mt7530_port_bridge_join(struct dsa_switch *ds, int port,
> > struct netlink_ext_ack *extack)
> > {
> > struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
> > - u32 port_bitmap = BIT(MT7530_CPU_PORT);
> > struct mt7530_priv *priv = ds->priv;
> > + u32 port_bitmap = BIT(priv->cpu_port);
>
> No need to re-order these two lines.
imho it is needed as i now access priv-struct now ;) which is not available at the "old" position
> >
> > mutex_lock(&priv->reg_mutex);
> > @@ -1503,6 +1504,7 @@ static int
> > mt7530_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering,
> > struct netlink_ext_ack *extack)
> > {
> > + struct mt7530_priv *priv = ds->priv;
>
> Add a space to separate declaration from code.
OK
> > --- a/drivers/net/dsa/mt7530.h
> > +++ b/drivers/net/dsa/mt7530.h
> > @@ -8,7 +8,6 @@
> >
> > #define MT7530_NUM_PORTS 7
> > #define MT7530_NUM_PHYS 5
> > -#define MT7530_CPU_PORT 6
>
> We could have kept this define and rename it MT7530_DEFAULT_CPU_PORT or
> something and in m7530_probe() use that newly renamed constant to
> illustrate that we have a default value assigned, just in case.
i do
> > #define MT7530_NUM_FDB_RECORDS 2048
> > #define MT7530_ALL_MEMBERS 0xff
> >
> > @@ -823,6 +822,7 @@ struct mt7530_priv {
> > u8 mirror_tx;
> >
> > struct mt7530_port ports[MT7530_NUM_PORTS];
> > + int cpu_port;
>
> This can be an unsigned integer since you do not assign negative values.
> With that fixes, this looks good to me.
ok, i change to unsigned int
regards Frank
Powered by blists - more mailing lists