Re: [PATCH] RDMA: Replace msecs_to_jiffies with secs_to_jiffies for timeout

From: Jason Gunthorpe
Date: Mon Apr 07 2025 - 14:09:46 EST


On Wed, Mar 26, 2025 at 10:19:55PM +0800, ye.xingchen@xxxxxxxxxx wrote:
> From: Peng Jiang <jiang.peng9@xxxxxxxxxx>
>
> In drivers/infiniband/hw/mlx4/mcg.c and drivers/infiniband/hw/mlx5/mr.c,
> `msecs_to_jiffies` is used to convert milliseconds to jiffies.
> For constant milliseconds, using `msecs_to_jiffies` introduces additional
> computational overhead. For example, it is unnecessary to check
> if m > jiffies_to_msecs(MAX_JIFFY_OFFSET) or (int)m < 0 for constants,
> while using `secs_to_jiffies` can avoid these extra calculations.
>
> Signed-off-by: Peng Jiang <jiang.peng9@xxxxxxxxxx>
> Signed-off-by: Ye Xingchen <ye.xingchen@xxxxxxxxxx>
> ---
> drivers/infiniband/hw/mlx4/mcg.c | 8 ++++----
> drivers/infiniband/hw/mlx5/mr.c | 6 +++---
> 2 files changed, 7 insertions(+), 7 deletions(-)

Applied without the mlx5 portion, Easwar got there first, thanks

Jason