lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210112105313.rka5m6ha6qjwjpcn@skbuf>
Date:   Tue, 12 Jan 2021 12:53:13 +0200
From:   Vladimir Oltean <olteanv@...il.com>
To:     Marek Behún <kabel@...nel.org>
Cc:     netdev@...r.kernel.org, pavana.sharma@...i.com,
        vivien.didelot@...il.com, f.fainelli@...il.com, kuba@...nel.org,
        lkp@...el.com, davem@...emloft.net, ashkan.boldaji@...i.com,
        andrew@...n.ch, Chris Packham <chris.packham@...iedtelesis.co.nz>,
        Russell King - ARM Linux admin <linux@...linux.org.uk>
Subject: Re: [PATCH net-next v14 4/6] net: dsa: mv88e6xxx: wrap
 .set_egress_port method

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@...nel.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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ