From: Vladimir Oltean <olteanv@gmail.com>
To: "Marek Behún" <kabel@kernel.org>
Cc: netdev@vger.kernel.org, pavana.sharma@digi.com,
vivien.didelot@gmail.com, f.fainelli@gmail.com, kuba@kernel.org,
lkp@intel.com, davem@davemloft.net, ashkan.boldaji@digi.com,
andrew@lunn.ch, Chris Packham <chris.packham@alliedtelesis.co.nz>,
Russell King - ARM Linux admin <linux@armlinux.org.uk>
Subject: Re: [PATCH net-next v14 4/6] net: dsa: mv88e6xxx: wrap .set_egress_port method
Date: Tue, 12 Jan 2021 12:53:13 +0200 [thread overview]
Message-ID: <20210112105313.rka5m6ha6qjwjpcn@skbuf> (raw)
In-Reply-To: <20210111012156.27799-5-kabel@kernel.org>
On Mon, Jan 11, 2021 at 02:21:54AM +0100, Marek Behún wrote:
> There are two implementations of the .set_egress_port method, and both
> of them, if successful, set chip->*gress_dest_port variable.
>
> To avoid code repetition, wrap this method into
> mv88e6xxx_set_egress_port.
>
> Signed-off-by: Marek Behún <kabel@kernel.org>
> ---
> drivers/net/dsa/mv88e6xxx/chip.c | 48 ++++++++++++++++++-----------
> drivers/net/dsa/mv88e6xxx/global1.c | 19 ++----------
> 2 files changed, 32 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 9bddd70449c6..62bef0759077 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -2521,6 +2521,26 @@ static int mv88e6xxx_serdes_power(struct mv88e6xxx_chip *chip, int port,
> return err;
> }
>
> +static int mv88e6xxx_set_egress_port(struct mv88e6xxx_chip *chip,
> + enum mv88e6xxx_egress_direction direction,
> + int port)
> +{
> + int err = -EOPNOTSUPP;
> +
> + if (chip->info->ops->set_egress_port) {
I would probably return -EOPNOTSUPP early and reduce the indentation
level by one:
if (!chip->info->ops->set_egress_port)
return -EOPNOTSUPP;
next prev parent reply other threads:[~2021-01-12 10:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-11 1:21 [PATCH net-next v14 0/6] Add support for mv88e6393x family of Marvell Marek Behún
2021-01-11 1:21 ` [PATCH net-next v14 1/6] dt-bindings: net: Add 5GBASER phy interface Marek Behún
2021-01-11 16:41 ` Andrew Lunn
2021-01-11 1:21 ` [PATCH net-next v14 2/6] net: phy: Add 5GBASER interface mode Marek Behún
2021-01-11 16:48 ` Russell King - ARM Linux admin
2021-01-11 17:49 ` Marek Behún
2021-01-11 1:21 ` [PATCH net-next v14 3/6] net: dsa: mv88e6xxx: Change serdes lane parameter type from u8 type to int Marek Behún
2021-01-12 10:53 ` Vladimir Oltean
2021-01-11 1:21 ` [PATCH net-next v14 4/6] net: dsa: mv88e6xxx: wrap .set_egress_port method Marek Behún
2021-01-11 5:57 ` Pavana Sharma
2021-01-12 10:53 ` Vladimir Oltean [this message]
2021-01-11 1:21 ` [PATCH net-next v14 5/6] net: dsa: mv88e6xxx: Add support for mv88e6393x family of Marvell Marek Behún
2021-01-12 11:11 ` Vladimir Oltean
2021-01-12 16:02 ` Marek Behún
2021-01-12 16:29 ` Russell King - ARM Linux admin
2021-01-12 16:37 ` Marek Behún
2021-01-12 18:06 ` Marek Behún
2021-01-12 21:58 ` Vladimir Oltean
2021-01-13 3:56 ` Marek Behún
2021-01-11 1:21 ` [PATCH net-next v14 6/6] net: dsa: mv88e6xxx: implement .port_set_policy for Amethyst Marek Behún
2021-01-11 6:00 ` Pavana Sharma
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=20210112105313.rka5m6ha6qjwjpcn@skbuf \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=ashkan.boldaji@digi.com \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kabel@kernel.org \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lkp@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pavana.sharma@digi.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;
as well as URLs for NNTP newsgroup(s).