From: Vladimir Oltean <olteanv@gmail.com>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Tom Rix <trix@redhat.com>, Jens Axboe <axboe@kernel.dk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
llvm@lists.linux.dev
Subject: Re: [net-next PATCH v4 09/14] net: dsa: qca8k: move set age/MTU/port enable/disable functions to common code
Date: Tue, 26 Jul 2022 03:17:20 +0300 [thread overview]
Message-ID: <20220726001720.d75t26oigcdp2eca@skbuf> (raw)
In-Reply-To: <20220724201938.17387-10-ansuelsmth@gmail.com> <20220724201938.17387-10-ansuelsmth@gmail.com>
On Sun, Jul 24, 2022 at 10:19:33PM +0200, Christian Marangi wrote:
> The same set age, MTU and port enable/disable function are used by
> driver based on qca8k family switch.
> Move them to common code to make them accessible also by other drivers.
> While at it also drop unnecessary qca8k_priv cast for void pointers.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
> diff --git a/drivers/net/dsa/qca/qca8k-common.c b/drivers/net/dsa/qca/qca8k-common.c
> index a50c21c90e81..7e573827dac6 100644
> --- a/drivers/net/dsa/qca/qca8k-common.c
> +++ b/drivers/net/dsa/qca/qca8k-common.c
> @@ -373,3 +373,91 @@ void qca8k_port_bridge_leave(struct dsa_switch *ds, int port,
> qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port),
> QCA8K_PORT_LOOKUP_MEMBER, BIT(cpu_port));
> }
> +
> +int
> +qca8k_set_ageing_time(struct dsa_switch *ds, unsigned int msecs)
Same comment about prototypes now fitting a single line. I won't be
making this comment everywhere.
> +{
> + struct qca8k_priv *priv = ds->priv;
> + unsigned int secs = msecs / 1000;
> + u32 val;
> +
> + /* AGE_TIME reg is set in 7s step */
> + val = secs / 7;
> +
> + /* Handle case with 0 as val to NOT disable
> + * learning
> + */
> + if (!val)
> + val = 1;
> +
> + return regmap_update_bits(priv->regmap, QCA8K_REG_ATU_CTRL, QCA8K_ATU_AGE_TIME_MASK,
> + QCA8K_ATU_AGE_TIME(val));
Maybe now would be a good time to trim this line to 80 characters?
Networking wasn't a huge fan of the 100 character limit increase,
I think this might even be pointed out in the process docs.
next prev parent reply other threads:[~2022-07-26 0:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-24 20:19 [net-next PATCH v4 00/14] net: dsa: qca8k: code split for qca8k Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 01/14] net: dsa: qca8k: cache match data to speed up access Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 02/14] net: dsa: qca8k: make mib autocast feature optional Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 03/14] net: dsa: qca8k: move mib struct to common code Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 04/14] net: dsa: qca8k: move qca8k read/write/rmw and reg table " Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 05/14] net: dsa: qca8k: move qca8k bulk read/write helper " Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 06/14] net: dsa: qca8k: move mib init function " Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 07/14] net: dsa: qca8k: move port set status/eee/ethtool stats " Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 08/14] net: dsa: qca8k: move bridge functions " Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 09/14] net: dsa: qca8k: move set age/MTU/port enable/disable " Christian Marangi
2022-07-26 0:17 ` Vladimir Oltean [this message]
2022-07-24 20:19 ` [net-next PATCH v4 10/14] net: dsa: qca8k: move port FDB/MDB function " Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 11/14] net: dsa: qca8k: move port mirror functions " Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 12/14] net: dsa: qca8k: move port VLAN " Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 13/14] net: dsa: qca8k: move port LAG " Christian Marangi
2022-07-24 20:19 ` [net-next PATCH v4 14/14] net: dsa: qca8k: move read_switch_id function " Christian Marangi
2022-07-26 0:22 ` [net-next PATCH v4 00/14] net: dsa: qca8k: code split for qca8k Vladimir Oltean
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=20220726001720.d75t26oigcdp2eca@skbuf \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=axboe@kernel.dk \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=trix@redhat.com \
--cc=vivien.didelot@gmail.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