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] [day] [month] [year] [list]
Message-ID: <20240405181925.GT26556@kernel.org>
Date: Fri, 5 Apr 2024 19:19:25 +0100
From: Simon Horman <horms@...nel.org>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: "David S. Miller" <davem@...emloft.net>, Andrew Lunn <andrew@...n.ch>,
	Eric Dumazet <edumazet@...gle.com>,
	Florian Fainelli <f.fainelli@...il.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Vladimir Oltean <olteanv@...il.com>,
	Woojung Huh <woojung.huh@...rochip.com>,
	Arun Ramadoss <arun.ramadoss@...rochip.com>, kernel@...gutronix.de,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	UNGLinuxDriver@...rochip.com, David Ahern <dsahern@...nel.org>,
	Willem de Bruijn <willemb@...gle.com>,
	Søren Andersen <san@...v.dk>
Subject: Re: [PATCH net-next v2 6/9] net: dsa: microchip: dcb: add special
 handling for KSZ88X3 family

On Wed, Apr 03, 2024 at 11:29:02AM +0200, Oleksij Rempel wrote:

...

> diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
> index 0ead198bacb2c..a520352d5b93e 100644
> --- a/drivers/net/dsa/microchip/ksz8795.c
> +++ b/drivers/net/dsa/microchip/ksz8795.c
> @@ -179,6 +179,21 @@ static int ksz8_port_queue_split(struct ksz_device *dev, int port, int queues)
>  	return ksz_prmw8(dev, port, reg_2q, mask_2q, data_2q);
>  }
>  
> +int ksz8_all_queues_split(struct ksz_device *dev, int queues)
> +{
> +	struct dsa_switch *ds = dev->ds;
> +	const struct dsa_port *dp;
> +	int ret;
> +
> +	dsa_switch_for_each_port(dp, ds) {
> +		ret = ksz8_port_queue_split(dev, dp->index, queues);
> +		if (ret)
> +			return ret;
> +	}
> +
> +	return ret;

nit: Probably it can't occur, but if dsa_switch_for_each_port() iterates
     zero times then ret is used uninitialised here.

     In any case, perhaps it is slightly nicer to reduce the scope
     of ret to inside the loop, and simply return 0 here.

> +}
> +
>  void ksz8_r_mib_cnt(struct ksz_device *dev, int port, u16 addr, u64 *cnt)
>  {
>  	const u32 *masks;

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ