[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_9E44A7B2F489B91A12A11C2639C5A4B9F40A@qq.com>
Date: Wed, 20 Nov 2024 14:27:53 +0800
From: Cong Yi <yicong.srfy@...mail.com>
To: linux@...linux.org.uk,
andrew@...n.ch,
hkallweit1@...il.com
Cc: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Cong Yi <yicong@...inos.cn>
Subject: [PATCH] net: phylink: Separating two unrelated definitions for improving code readability
From: Cong Yi <yicong@...inos.cn>
After the support of PCS state machine, phylink and pcs two
unrelated state enum definitions are put together, which brings
some confusion to code reading.
This patch defines the two separately.
Signed-off-by: Cong Yi <yicong@...inos.cn>
---
drivers/net/phy/phylink.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 3e9957b6aa14..1c65fd29538d 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -30,11 +30,13 @@
(ADVERTISED_TP | ADVERTISED_MII | ADVERTISED_FIBRE | \
ADVERTISED_BNC | ADVERTISED_AUI | ADVERTISED_Backplane)
-enum {
+enum phylink_disable_state {
PHYLINK_DISABLE_STOPPED,
PHYLINK_DISABLE_LINK,
PHYLINK_DISABLE_MAC_WOL,
+};
+enum phylink_pcs_state {
PCS_STATE_DOWN = 0,
PCS_STATE_STARTING,
PCS_STATE_STARTED,
@@ -76,7 +78,7 @@ struct phylink {
struct phylink_link_state phy_state;
struct work_struct resolve;
unsigned int pcs_neg_mode;
- unsigned int pcs_state;
+ enum phylink_pcs_state pcs_state;
bool link_failed;
bool using_mac_select_pcs;
--
2.25.1
Powered by blists - more mailing lists