Subject: Re: [PATCH v2 resub 1/2] net: include: mii: Refactor: Define LPA_* in terms of ADVERTISE_*

From: "Russell King (Oracle)" <[email-masked]>
Date: Fri, 21 Jun 2024 13:30:41 +0100

On Fri, Jun 21, 2024 at 09:48:23AM +0200, Csókás Bence wrote:
> Hi
> 
> On 6/20/24 21:07, Andrew Lunn wrote:
> > On Wed, Jun 19, 2024 at 02:46:22PM +0200, Csókás, Bence wrote:
> > > Ethernet specification mandates that these bits will be equal.
> > > To reduce the amount of magix hex'es in the code, just define
> > > them in terms of each other.
> > 
> > I have a quick email exchange with other PHY maintainers, and we
> > agree. We will reject these changes, they are just churn and bring no
> > real benefit.
> > 
> > NACK
> > 
> >      Andrew
> > 
> 
> The benefit is that I don't have to constantly convert between "n-th bit
> set" (which is how virtually all datasheets, specifications, documentation
> etc. represent MII bits) and these hex values. In most places in the kernel,
> register bits are already represented with BIT() et al., so why not here?

These are user API files, you can't use BIT() here (BIT() isn't defined
for userspace header files.) Next, these are 'int's not 'longs' so
using BIT() or _BITUL() could cause warnings - plus it changes the
type of these definitions not only for kernel space but also user space.
Thus, it's an API change.

So no, we're not making changes to make this "more readable" at the
expense of breaking the kernel's UAPI.

Just get used to working with hex numbers like most of us had to do
before BIT() was added to the kernel... it's not difficult, each hex
digit is after all four binary bits. It's not like it's decimal.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!