netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Eric Dumazet" <edumazet@google.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"Woojung Huh" <woojung.huh@microchip.com>,
	"Arun Ramadoss" <arun.ramadoss@microchip.com>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, UNGLinuxDriver@microchip.com,
	"David Ahern" <dsahern@kernel.org>,
	"Willem de Bruijn" <willemb@google.com>,
	"Søren Andersen" <san@skov.dk>
Subject: Re: [PATCH net-next v2 6/9] net: dsa: microchip: dcb: add special handling for KSZ88X3 family
Date: Fri, 5 Apr 2024 19:19:25 +0100	[thread overview]
Message-ID: <20240405181925.GT26556@kernel.org> (raw)
In-Reply-To: <20240403092905.2107522-7-o.rempel@pengutronix.de>

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;

...

  reply	other threads:[~2024-04-05 18:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03  9:28 [PATCH net-next v2 0/9] Enhanced DCB and DSCP Support for KSZ Switches Oleksij Rempel
2024-04-03  9:28 ` [PATCH net-next v2 1/9] net: dsa: add support for DCB get/set apptrust configuration Oleksij Rempel
2024-04-03 13:05   ` Florian Fainelli
2024-04-03  9:28 ` [PATCH net-next v2 2/9] net: dsa: microchip: add IPV information support Oleksij Rempel
2024-04-03 10:34   ` Ratheesh Kannoth
2024-04-03 11:36   ` Vladimir Oltean
2024-04-03  9:28 ` [PATCH net-next v2 3/9] net: add IEEE 802.1q specific helpers Oleksij Rempel
2024-04-05 18:16   ` Simon Horman
2024-04-03  9:29 ` [PATCH net-next v2 4/9] net: dsa: microchip: add multi queue support for KSZ88X3 variants Oleksij Rempel
2024-04-03  9:29 ` [PATCH net-next v2 5/9] net: dsa: microchip: add support for different DCB app configurations Oleksij Rempel
2024-04-04  0:42   ` Jakub Kicinski
2024-04-03  9:29 ` [PATCH net-next v2 6/9] net: dsa: microchip: dcb: add special handling for KSZ88X3 family Oleksij Rempel
2024-04-05 18:19   ` Simon Horman [this message]
2024-04-03  9:29 ` [PATCH net-next v2 7/9] net: dsa: microchip: enable ETS support for KSZ989X variants Oleksij Rempel
2024-04-03  9:29 ` [PATCH net-next v2 8/9] net: dsa: microchip: init predictable IPV to queue mapping for all non KSZ8xxx variants Oleksij Rempel
2024-04-03  9:29 ` [PATCH net-next v2 9/9] net: dsa: microchip: let DCB code do PCP and DSCP policy configuration Oleksij Rempel

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=20240405181925.GT26556@kernel.org \
    --to=horms@kernel.org \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=arun.ramadoss@microchip.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=san@skov.dk \
    --cc=willemb@google.com \
    --cc=woojung.huh@microchip.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).