lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1ed10006-79e8-47c7-9920-e38343b2c987@lunn.ch>
Date: Wed, 27 Aug 2025 14:24:40 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Xichao Zhao <zhao.xichao@...o.com>
Cc: 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, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: stmmac: use us_to_ktime() where appropriate

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@...o.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ