drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
STMMAC_COAL_TIMER(x) is more suitable for using the us_to_ktime().
This can make the code more concise and enhance readability.
Therefore, replace ns_to_ktime() with us_to_ktime().
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f1abf4242cd2..dcbd180c1985 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -144,7 +144,7 @@ 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))
+#define STMMAC_COAL_TIMER(x) (us_to_ktime(x))
int stmmac_bus_clks_config(struct stmmac_priv *priv, bool enabled)
{
--
2.34.1
On Wed, Aug 27, 2025 at 10:07:55AM +0800, Xichao Zhao wrote: > STMMAC_COAL_TIMER(x) is more suitable for using the us_to_ktime(). > This can make the code more concise and enhance readability. > Therefore, replace ns_to_ktime() with us_to_ktime(). > > Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com> > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index f1abf4242cd2..dcbd180c1985 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -144,7 +144,7 @@ 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)) > +#define STMMAC_COAL_TIMER(x) (us_to_ktime(x)) Now that the macro does nothing, please just use us_time_ktime() inline and remove the macro. Also: https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html Andrew --- pw-bot: cr
© 2016 - 2025 Red Hat, Inc.