[net-next v2] net: stmmac: use us_to_ktime function to replace STMMAC_COAL_TIMER macro

Xichao Zhao posted 1 patch 1 month ago
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[net-next v2] net: stmmac: use us_to_ktime function to replace STMMAC_COAL_TIMER macro
Posted by Xichao Zhao 1 month ago
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@vivo.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
Re: [net-next v2] net: stmmac: use us_to_ktime function to replace STMMAC_COAL_TIMER macro
Posted by Jakub Kicinski 1 month ago
On Fri, 29 Aug 2025 14:47:22 +0800 Xichao Zhao wrote:
> -#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;

There has been another change here in the meantime.
Please rebase and repost.
-- 
pw-bot: cr
Re: [net-next v2] net: stmmac: use us_to_ktime function to replace STMMAC_COAL_TIMER macro
Posted by Andrew Lunn 1 month ago
On Fri, Aug 29, 2025 at 02:47:22PM +0800, Xichao Zhao wrote:
> 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@vivo.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew