[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b664b744-ddfd-409d-bee3-9e7e1dc0b5b2@lunn.ch>
Date: Tue, 27 Jan 2026 19:34:41 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Daniel Golle <daniel@...rotopia.org>
Cc: Paolo Abeni <pabeni@...hat.com>, Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Simon Horman <horms@...nel.org>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Frank Wunderlich <frankwu@....de>, Chad Monroe <chad@...roe.io>,
Cezary Wilmanski <cezary.wilmanski@...ran.com>,
Avinash Jayaraman <ajayaraman@...linear.com>,
Bing tao Xu <bxu@...linear.com>, Liang Xu <lxu@...linear.com>,
Juraj Povazanec <jpovazanec@...linear.com>,
"Fanni (Fang-Yi) Chan" <fchan@...linear.com>,
"Benny (Ying-Tsan) Weng" <yweng@...linear.com>,
"Livia M. Rosu" <lrosu@...linear.com>,
John Crispin <john@...ozen.org>
Subject: Re: [PATCH net-next v8 4/4] net: dsa: add basic initial driver for
MxL862xx switches
On Tue, Jan 27, 2026 at 04:07:10PM +0000, Daniel Golle wrote:
> On Tue, Jan 27, 2026 at 04:04:10PM +0100, Andrew Lunn wrote:
> > > > int mxl862xx_to_zephyr_errno(u16 reg)
> > > so that would then just be
> > > return (s16)reg;
> > > right?
> >
> > Yes.
>
> +1
>
> Maybe better to check if bit 16~31 is actually zero as well, so
> int mxl862xx_to_zephyr_errno(int reg)
> {
> if (reg >= 0 && reg <= U16_MAX)
> return (s16)reg;
>
> return 0;
If bits 16~31 are not zero, i would say the MDIO driver is broken, and
we should fix it. Returning 0 is going to hide such issues. If you are
worried about it, at least add a WARN_ON() or something.
Andrew
Powered by blists - more mailing lists