[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241121105044.rbjp2deo5orce3me@skbuf>
Date: Thu, 21 Nov 2024 12:50:44 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Cong Yi <yicong.srfy@...mail.com>, linux@...linux.org.uk
Cc: andrew@...n.ch, hkallweit1@...il.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, yicong@...inos.cn
Subject: Re: [PATCH] net: phylink: Separating two unrelated definitions for
improving code readability
On Wed, Nov 20, 2024 at 05:46:14PM +0800, Cong Yi wrote:
> Hi, Russell King:
>
> Thank you for your reply!
> Yes, as you say, there is no problem with the definitions themselves
> being named. When I just read from Linux-5.4 to 6.6, I thought
> that PCS_STATE_ and PHYLINK_DISABLE- were associated in some way.
> After reading the code carefully, I found that there was no correlation。
> In order to avoid similar confusion, I sent this patch.
For the record, I agree that tying together unrelated constants inside
the same anonymous enum and resetting the counter is a confusing coding
pattern, to which I don't see the benefit. Separating them and giving
names to the enums also gives the opportunity for stronger typing, which
was done here. I think the patch (or at least its idea) is ok.
Powered by blists - more mailing lists