From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: sashiko-reviews@lists.linux.dev
Cc: vkoul@kernel.org, olteanv@gmail.com, neil.armstrong@linaro.org,
linux-phy@lists.infradead.org
Subject: Re: [PATCH phy-next 10/13] phy: lynx-28g: add support for big endian register maps
Date: Fri, 29 May 2026 15:00:05 +0300 [thread overview]
Message-ID: <20260529120005.icj44ffdvdk25fjm@skbuf> (raw)
In-Reply-To: <20260528174757.9AFF31F000E9@smtp.kernel.org>
On Thu, May 28, 2026 at 05:47:57PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] Returning an expression in a function with a 'void' return type is a constraint violation in standard C.
> --
>
> commit f3cbe0a1122ada7c6725f37e9dc47932febfd4ad
> Author: Vladimir Oltean <vladimir.oltean@nxp.com>
>
> phy: lynx-28g: add support for big endian register maps
>
> This commit adds support for big-endian 10G Lynx SerDes blocks. It reads
> the "big-endian" device tree property and updates the lynx_read() and
> lynx_write() accessors to use the appropriate ioread32be/iowrite32be or
> ioread32/iowrite32 variants based on the endianness.
>
> > diff --git a/drivers/phy/freescale/phy-fsl-lynx-core.h b/drivers/phy/freescale/phy-fsl-lynx-core.h
> > index e8b280cc9b38c..d82e529fa65a6 100644
> > --- a/drivers/phy/freescale/phy-fsl-lynx-core.h
> > +++ b/drivers/phy/freescale/phy-fsl-lynx-core.h
>
> [ ... ]
>
> > @@ -58,36 +58,52 @@ struct lynx_priv {
> > * like PCCn
> > */
> > spinlock_t pcc_lock;
> > + bool big_endian;
> > struct lynx_pll pll[LYNX_NUM_PLL];
> > struct lynx_lane *lane;
> >
> > struct delayed_work cdr_check;
> > };
> >
> > +static inline u32 lynx_read(struct lynx_priv *priv, unsigned long off)
> > +{
> > + void __iomem *reg = priv->base + off;
> > +
> > + if (priv->big_endian)
> > + return ioread32be(reg);
> > +
> > + return ioread32(reg);
> > +}
> > +
> > +static inline void lynx_write(struct lynx_priv *priv, unsigned long off, u32 val)
> > +{
> > + void __iomem *reg = priv->base + off;
> > +
> > + if (priv->big_endian)
> > + return iowrite32be(val, reg);
>
> [Severity: Low]
> Does this code unintentionally return a void expression?
>
> The lynx_write() function is declared with a void return type, but it uses
> the return keyword before calling iowrite32be() and iowrite32() which also
> evaluate to void.
>
> While GNU C allows returning a void expression as an extension, standard C
> does not permit it, and it could trigger warnings in strict static analysis
> tools. Would it be better to just drop the return keywords here?
>
> > +
> > + return iowrite32(val, reg);
> > +}
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260528172404.733196-1-vladimir.oltean@nxp.com?part=10
This was intentional, because "return iowrite32be()" also stops the control flow
and is more succinct than "{ iowrite32be(); return; }".
I thought the pattern was widely accepted, see include/linux/skbuff.h:
static inline void consume_skb(struct sk_buff *skb)
{
return kfree_skb(skb);
}
Unless a human has a valid objection, I will disregard this feedback.
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-05-29 12:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 17:23 [PATCH phy-next 00/13] New Generic PHY driver for Lynx 10G SerDes Vladimir Oltean
2026-05-28 17:23 ` [PATCH phy-next 01/13] dt-bindings: phy: lynx-10g: initial document Vladimir Oltean
2026-05-28 17:40 ` sashiko-bot
2026-05-28 17:45 ` Vladimir Oltean
2026-05-29 12:50 ` Vladimir Oltean
2026-06-05 19:04 ` Rob Herring (Arm)
2026-05-28 17:23 ` [PATCH phy-next 02/13] phy: lynx-28g: move lane mode helpers to new core module Vladimir Oltean
2026-05-28 17:23 ` [PATCH phy-next 03/13] phy: lynx-28g: move data structures to core Vladimir Oltean
2026-05-28 17:23 ` [PATCH phy-next 04/13] phy: lynx-28g: common lynx_pll_get() Vladimir Oltean
2026-05-28 17:23 ` [PATCH phy-next 05/13] phy: lynx-28g: generalize protocol converter accessors Vladimir Oltean
2026-05-28 17:23 ` [PATCH phy-next 06/13] phy: lynx-28g: provide default lynx_lane_supports_mode() implementation Vladimir Oltean
2026-05-28 17:23 ` [PATCH phy-next 07/13] phy: lynx-28g: move struct lynx_info definitions downwards Vladimir Oltean
2026-05-28 17:23 ` [PATCH phy-next 08/13] phy: lynx-28g: make lynx_28g_pll_read_configuration() callable per PLL Vladimir Oltean
2026-05-28 17:46 ` sashiko-bot
2026-05-28 17:24 ` [PATCH phy-next 09/13] phy: lynx-28g: common probe() and remove() Vladimir Oltean
2026-05-28 18:02 ` sashiko-bot
2026-05-29 12:47 ` Vladimir Oltean
2026-05-28 17:24 ` [PATCH phy-next 10/13] phy: lynx-28g: add support for big endian register maps Vladimir Oltean
2026-05-28 17:47 ` sashiko-bot
2026-05-29 12:00 ` Vladimir Oltean [this message]
2026-05-28 17:24 ` [PATCH phy-next 11/13] phy: lynx-28g: optimize read-modify-write operation Vladimir Oltean
2026-05-28 17:24 ` [PATCH phy-next 12/13] phy: lynx-10g: new driver Vladimir Oltean
2026-05-28 18:20 ` sashiko-bot
2026-05-29 12:34 ` Vladimir Oltean
2026-05-28 17:24 ` [PATCH phy-next 13/13] MAINTAINERS: expand Lynx 28G entry to cover Lynx 10G SerDes Vladimir Oltean
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=20260529120005.icj44ffdvdk25fjm@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=linux-phy@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vkoul@kernel.org \
/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