mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Yang <mmyangfl@gmail.com>
Cc: netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/4] net: dsa: yt921x: Refactor long register helpers
Date: Fri, 3 Apr 2026 02:26:14 +0200	[thread overview]
Message-ID: <112370b9-0e2c-4d5c-a614-4eca5593b2d8@lunn.ch> (raw)
In-Reply-To: <20260402223437.109097-3-mmyangfl@gmail.com>

> -static int yt921x_reg64_write(struct yt921x_priv *priv, u32 reg, u64 val)

> +yt921x_reg64_write(struct yt921x_priv *priv, u32 reg, const u32 *vals)
> +{

The old reg64_write actually took a u64 value, so the name fit. The
new one takes 2x a u32. So i'm not sure calling is reg64 actually
fits. Maybe yt921x_reg32x2_write()?

> +static int yt921x_vlan_del(struct yt921x_priv *priv, int port, u16 vid)
>  {
> -	u64 mask64;
> +	u32 masks[2];
>  
> -	mask64 = YT921X_VLAN_CTRL_PORTS(port) |
> -		 YT921X_VLAN_CTRL_UNTAG_PORTn(port);
> +	masks[0] = YT921X_VLAN_CTRLa_PORTn(port);
> +	masks[1] = YT921X_VLAN_CTRLb_UNTAG_PORTn(port);
>  
> -	return yt921x_reg64_clear_bits(priv, YT921X_VLANn_CTRL(vid), mask64);
> +	return yt921x_reg64_clear_bits(priv, YT921X_VLANn_CTRL(vid), masks);

Or you could make yt921x_reg64_write() continue to take a u64, and
avoid all these changes?

How does the datasheet describe these registers? Are they 64bit
registers, or 2x 32bit registers?

	   Andrew

  reply	other threads:[~2026-04-03  0:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 22:34 [PATCH net-next v2 0/4] net: dsa: yt921x: Add port police/tbf support David Yang
2026-04-02 22:34 ` [PATCH net-next v2 1/4] net: dsa: pass extack to user tc policers David Yang
2026-04-03  0:12   ` Andrew Lunn
2026-04-02 22:34 ` [PATCH net-next v2 2/4] net: dsa: yt921x: Refactor long register helpers David Yang
2026-04-03  0:26   ` Andrew Lunn [this message]
2026-04-03  0:44     ` David Yang
2026-04-02 22:34 ` [PATCH net-next v2 3/4] net: dsa: yt921x: Add port police support David Yang
2026-04-03  0:41   ` Andrew Lunn
2026-04-03  0:57     ` David Yang
2026-04-03 14:19       ` Andrew Lunn
2026-04-03 15:18         ` David Yang
2026-04-02 22:34 ` [PATCH net-next v2 4/4] net: dsa: yt921x: Add port qdisc tbf support David Yang

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=112370b9-0e2c-4d5c-a614-4eca5593b2d8@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmyangfl@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®