public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cong Yi <yicong.srfy@foxmail.com>
To: linux@armlinux.org.uk, andrew@lunn.ch, hkallweit1@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Cong Yi <yicong@kylinos.cn>
Subject: [PATCH] net: phylink: Separating two unrelated definitions for improving code readability
Date: Wed, 20 Nov 2024 14:27:53 +0800	[thread overview]
Message-ID: <tencent_9E44A7B2F489B91A12A11C2639C5A4B9F40A@qq.com> (raw)

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


             reply	other threads:[~2024-11-20  6:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20  6:27 Cong Yi [this message]
2024-11-20  8:48 ` [PATCH] net: phylink: Separating two unrelated definitions for improving code readability Russell King (Oracle)
2024-11-20  9:46   ` Cong Yi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_9E44A7B2F489B91A12A11C2639C5A4B9F40A@qq.com \
    --to=yicong.srfy@foxmail.com \
    --cc=andrew@lunn.ch \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=yicong@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox