From: Andrew Lunn <andrew@lunn.ch>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: "Linus Walleij" <linusw@kernel.org>,
"Luiz Angelo Daros de Luca" <luizluca@gmail.com>,
"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>,
kernel@pengutronix.de, linux-kernel@vger.kernel.org,
"Ahmad Fatoum" <a.fatoum@pengutronix.de>,
"Alvin Šipraga" <alvin.sipraga@analog.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next v3 2/3] net: dsa: realtek: rtl8365mb: extract PHY OCP address halves with FIELD_GET
Date: Wed, 16 Sep 2026 14:36:28 +0200 [thread overview]
Message-ID: <55eb74e5-b91b-4662-bc9d-60e92255b4e7@lunn.ch> (raw)
In-Reply-To: <20260916090102.349157-3-o.rempel@pengutronix.de>
On Wed, Sep 16, 2026 at 11:01:01AM +0200, Oleksij Rempel wrote:
> Extract the two OCP address halves with FIELD_GET() before handing them
> to FIELD_PREP() to build the ADDRESS register value.
>
> rtl8365mb_phy_ocp_prepare() previously fed FIELD_PREP() the raw
> ocp_addr >> 1 and >> 6. FIELD_PREP() masks the value to the field at run
> time, so that was correct for the current callers, which all pass a
> run-time register address.
>
> FIELD_PREP()'s compile-time width check only fires for a compile-time
> constant value. None reached it here: the address is computed as
> PHYREG_BASE + regnum * 2 from a run-time regnum. The EEE support that
> follows adds callers with constant OCP addresses (0xa5c4 etc.); clang
> folds those into the inlined ocp_prepare(), so the shifted constant now
> reaches the check, overflows the 5-/4-bit field and breaks the build
> (gcc does not fold it here). FIELD_GET() narrows each half to the field
> width first, so the value already fits.
>
> No functional change.
>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
next prev parent reply other threads:[~2026-09-16 12:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 9:00 [PATCH net-next v3 0/3] net: dsa: realtek: EEE support for RTL8365MB-VC Oleksij Rempel
2026-09-16 9:01 ` [PATCH net-next v3 1/3] net: phy: realtek: use C45 for RTL8365MB-VC internal PHY MMD access Oleksij Rempel
2026-09-18 3:03 ` netdev-bot+sashiko
2026-09-16 9:01 ` [PATCH net-next v3 2/3] net: dsa: realtek: rtl8365mb: extract PHY OCP address halves with FIELD_GET Oleksij Rempel
2026-09-16 12:36 ` Andrew Lunn [this message]
2026-09-16 12:49 ` Linus Walleij
2026-09-16 9:01 ` [PATCH net-next v3 3/3] net: dsa: realtek: rtl8365mb: add EEE support Oleksij Rempel
2026-09-18 3:03 ` netdev-bot+sashiko
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=55eb74e5-b91b-4662-bc9d-60e92255b4e7@lunn.ch \
--to=andrew@lunn.ch \
--cc=a.fatoum@pengutronix.de \
--cc=alvin.sipraga@analog.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luizluca@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--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®