netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next v2] net: stmmac: use us_to_ktime function to replace STMMAC_COAL_TIMER macro
@ 2025-08-29  6:47 Xichao Zhao
  2025-08-29 19:55 ` Andrew Lunn
  2025-09-01 20:26 ` Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Xichao Zhao @ 2025-08-29  6:47 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, mcoquelin.stm32,
	alexandre.torgue
  Cc: netdev, linux-kernel, Xichao Zhao

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


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

* Re: [net-next v2] net: stmmac: use us_to_ktime function to replace STMMAC_COAL_TIMER macro
  2025-08-29  6:47 [net-next v2] net: stmmac: use us_to_ktime function to replace STMMAC_COAL_TIMER macro Xichao Zhao
@ 2025-08-29 19:55 ` Andrew Lunn
  2025-09-01 20:26 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2025-08-29 19:55 UTC (permalink / raw)
  To: Xichao Zhao
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, mcoquelin.stm32,
	alexandre.torgue, netdev, linux-kernel

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

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

* Re: [net-next v2] net: stmmac: use us_to_ktime function to replace STMMAC_COAL_TIMER macro
  2025-08-29  6:47 [net-next v2] net: stmmac: use us_to_ktime function to replace STMMAC_COAL_TIMER macro Xichao Zhao
  2025-08-29 19:55 ` Andrew Lunn
@ 2025-09-01 20:26 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2025-09-01 20:26 UTC (permalink / raw)
  To: Xichao Zhao
  Cc: andrew+netdev, davem, edumazet, pabeni, mcoquelin.stm32,
	alexandre.torgue, netdev, linux-kernel

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

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

end of thread, other threads:[~2025-09-01 20:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29  6:47 [net-next v2] net: stmmac: use us_to_ktime function to replace STMMAC_COAL_TIMER macro Xichao Zhao
2025-08-29 19:55 ` Andrew Lunn
2025-09-01 20:26 ` Jakub Kicinski

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).