[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e5a4fc33-4fe2-4078-83e5-596dff96bef9@wanadoo.fr>
Date: Sun, 11 May 2025 12:06:38 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: "Russell King (Oracle)" <linux@...linux.org.uk>,
Christian Marangi <ansuelsmth@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Daniel Golle <daniel@...rotopia.org>,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [net PATCH] net: phy: aquantia: fix wrong GENMASK define for
LED_PROV_ACT_STRETCH
Le 11/05/2025 à 11:57, Russell King (Oracle) a écrit :
> On Sun, May 11, 2025 at 11:06:17AM +0200, Christian Marangi wrote:
>> In defining VEND1_GLOBAL_LED_PROV_ACT_STRETCH there was a typo where the
>> GENMASK definition was swapped.
>>
>> Fix it to prevent any kind of misconfiguration if ever this define will
>> be used in the future.
>
> I thought GENMASK() was supposed to warn about this kind of thing. I've
> questioned in the past whether GENMASK() is better than defining fields
> with hex numbers, and each time I see another repeat of this exact case,
> I re-question whether GENMASK() actually gives much benefit over hex
> numbers because it's just too easy to get the two arguments to
> GENMASK() swapped and it's never obvious that's happened.
>
> I don't remember there being a dribble of patches in the past
> correcting bitfields defined using hex numbers, but that seems common
> with GENMASK().
>
There is a compile time check, but in this case
VEND1_GLOBAL_LED_PROV_ACT_STRETCH looks unused. So it is never expanded
and compiled.
CJ
Powered by blists - more mailing lists