All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: David Yang <mmyangfl@gmail.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	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>,
	Russell King <linux@armlinux.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/3] net: dsa: yt921x: Add STP/MST support
Date: Fri, 24 Oct 2025 16:52:34 +0100	[thread overview]
Message-ID: <aPugwiMrKqlDW4c1@horms.kernel.org> (raw)
In-Reply-To: <20251024033237.1336249-2-mmyangfl@gmail.com>

On Fri, Oct 24, 2025 at 11:32:27AM +0800, David Yang wrote:

...

> +static int
> +yt921x_dsa_vlan_msti_set(struct dsa_switch *ds, struct dsa_bridge bridge,
> +			 const struct switchdev_vlan_msti *msti)
> +{
> +	struct yt921x_priv *priv = to_yt921x_priv(ds);
> +	u64 mask64;
> +	u64 ctrl64;
> +	int res;
> +
> +	if (!msti->vid)
> +		return -EINVAL;
> +	if (msti->msti <= 0 || msti->msti >= YT921X_MSTI_NUM)
> +		return -EINVAL;
> +
> +	mask64 = YT921X_VLAN_CTRL_STP_ID_M;

Hi David,

YT921X_VLAN_CTRL_STP_ID_M is defined as follows in yt931x.h

#define  YT921X_VLAN_CTRL_STP_ID_M              GENMASK(39, 36)

This creates an unsigned long mask. However, on 32bit systems,
unsigned long is only 32 bits wide. So this will result in
a build error on such systems.

In order to avoid this I think the declaration of YT921X_VLAN_CTRL_STP_ID_M
should be updated to use GENMASK_ULL. This is also likely true
for other, as yet unused, #defines in yt931x.h.


> +	ctrl64 = YT921X_VLAN_CTRL_STP_ID(msti->msti);
> +
> +	mutex_lock(&priv->reg_lock);
> +	res = yt921x_reg64_update_bits(priv, YT921X_VLANn_CTRL(msti->vid),
> +				       mask64, ctrl64);
> +	mutex_unlock(&priv->reg_lock);
> +
> +	return res;
> +}

...

-- 
pw-bot: changes-requested

  reply	other threads:[~2025-10-24 15:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24  3:32 [PATCH net-next 0/3] net: dsa: yt921x: Add STP/MST/HSR/LAG support David Yang
2025-10-24  3:32 ` [PATCH net-next 1/3] net: dsa: yt921x: Add STP/MST support David Yang
2025-10-24 15:52   ` Simon Horman [this message]
2025-10-25  1:23   ` kernel test robot
2025-10-25  2:39   ` kernel test robot
2025-10-25  5:43   ` kernel test robot
2025-10-26 23:54   ` Andrew Lunn
2025-10-24  3:32 ` [PATCH net-next 2/3] net: dsa: yt921x: Add HSR offloading support David Yang
2025-10-24  3:32 ` [PATCH net-next 3/3] net: dsa: yt921x: Add LAG " David Yang
  -- strict thread matches above, loose matches on Subject: below --
2025-10-25  1:23 [PATCH net-next 1/3] net: dsa: yt921x: Add STP/MST support kernel test robot

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=aPugwiMrKqlDW4c1@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.