netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: phylink: Separating two unrelated definitions for improving code readability
@ 2024-11-20  6:27 Cong Yi
  2024-11-20  8:48 ` Russell King (Oracle)
  2024-11-21  8:32 ` Paolo Abeni
  0 siblings, 2 replies; 13+ messages in thread
From: Cong Yi @ 2024-11-20  6:27 UTC (permalink / raw)
  To: linux, andrew, hkallweit1; +Cc: netdev, linux-kernel, Cong Yi

From: Cong Yi <yicong@kylinos.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@kylinos.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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-11-21 12:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-20  6:27 [PATCH] net: phylink: Separating two unrelated definitions for improving code readability Cong Yi
2024-11-20  8:48 ` Russell King (Oracle)
2024-11-20  9:46   ` Cong Yi
2024-11-21 10:50     ` Vladimir Oltean
2024-11-21 11:21       ` Russell King (Oracle)
2024-11-21 11:52         ` Vladimir Oltean
2024-11-21 12:11           ` Russell King (Oracle)
2024-11-21 12:15             ` Vladimir Oltean
2024-11-21 12:26               ` Russell King (Oracle)
2024-11-21 12:47                 ` Vladimir Oltean
2024-11-21 12:49                   ` Russell King (Oracle)
2024-11-21 12:54                     ` Vladimir Oltean
2024-11-21  8:32 ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).