public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vinitha Vijayan <vinithamvijayan723@gmail.com>
To: andrew@lunn.ch
Cc: netdev@vger.kernel.org, kuba@kernel.org, davem@davemloft.net,
	pabeni@redhat.com, linux-arm-msm@vger.kernel.org,
	Vinitha Vijayan <vinithamvijayan723@gmail.com>
Subject: [PATCH] net: phy: qcom: replace CDT poll magic numbers with named constants
Date: Thu, 15 Jan 2026 22:27:18 +0530	[thread overview]
Message-ID: <20260115165718.36809-1-vinithamvijayan723@gmail.com> (raw)

Replace hard-coded poll interval and timeout values in
at803x_cdt_wait_for_completion() with named macros.

This improves readability and documents the timing assumptions
used by the cable diagnostic test without changing behavior.

Signed-off-by: Vinitha Vijayan <vinithamvijayan723@gmail.com>
---
 drivers/net/phy/qcom/qcom-phy-lib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/qcom/qcom-phy-lib.c b/drivers/net/phy/qcom/qcom-phy-lib.c
index 965c2bb99a9b..cc4c6b254c62 100644
--- a/drivers/net/phy/qcom/qcom-phy-lib.c
+++ b/drivers/net/phy/qcom/qcom-phy-lib.c
@@ -9,6 +9,9 @@
 
 #include "qcom.h"
 
+#define AT803X_CDT_POLL_INTERVAL_US             30000
+#define AT803X_CDT_TIMEOUT_US                   100000
+
 MODULE_DESCRIPTION("Qualcomm PHY driver Common Functions");
 MODULE_AUTHOR("Matus Ujhelyi");
 MODULE_AUTHOR("Christian Marangi <ansuelsmth@gmail.com>");
@@ -484,7 +487,9 @@ int at803x_cdt_wait_for_completion(struct phy_device *phydev,
 	/* One test run takes about 25ms */
 	ret = phy_read_poll_timeout(phydev, AT803X_CDT, val,
 				    !(val & cdt_en),
-				    30000, 100000, true);
+				    AT803X_CDT_POLL_INTERVAL_US,
+				    AT803X_CDT_TIMEOUT_US,
+				    true);
 
 	return ret < 0 ? ret : 0;
 }
-- 
2.50.1


             reply	other threads:[~2026-01-15 16:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 16:57 Vinitha Vijayan [this message]
2026-01-15 17:23 ` [PATCH] net: phy: qcom: replace CDT poll magic numbers with named constants Andrew Lunn

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=20260115165718.36809-1-vinithamvijayan723@gmail.com \
    --to=vinithamvijayan723@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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