[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250829064722.521577-1-zhao.xichao@vivo.com>
Date: Fri, 29 Aug 2025 14:47:22 +0800
From: Xichao Zhao <zhao.xichao@...o.com>
To: andrew+netdev@...n.ch,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
mcoquelin.stm32@...il.com,
alexandre.torgue@...s.st.com
Cc: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Xichao Zhao <zhao.xichao@...o.com>
Subject: [net-next v2] net: stmmac: use us_to_ktime function to replace STMMAC_COAL_TIMER macro
Removing the redundant STMMAC_COAL_TIMER macro and replacing it
with us_to_ktime enhances standardization and improves code readability.
Signed-off-by: Xichao Zhao <zhao.xichao@...o.com>
---
v2:
- remove the STMMAC_COAL_TIMER macro.
- add "net-next" to the subject.
v1: https://lore.kernel.org/all/20250827020755.59665-1-zhao.xichao@vivo.com/
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f1abf4242cd2..2767ea5bd204 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -144,8 +144,6 @@ static void stmmac_init_fs(struct net_device *dev);
static void stmmac_exit_fs(struct net_device *dev);
#endif
-#define STMMAC_COAL_TIMER(x) (ns_to_ktime((x) * NSEC_PER_USEC))
-
int stmmac_bus_clks_config(struct stmmac_priv *priv, bool enabled)
{
int ret = 0;
@@ -3197,7 +3195,7 @@ static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue)
*/
if (unlikely(!napi_is_scheduled(napi)))
hrtimer_start(&tx_q->txtimer,
- STMMAC_COAL_TIMER(tx_coal_timer),
+ us_to_ktime(tx_coal_timer),
HRTIMER_MODE_REL);
else
hrtimer_try_to_cancel(&tx_q->txtimer);
--
2.34.1
Powered by blists - more mailing lists