]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/mlx5: convert timeouts to secs_to_jiffies()
authorEaswar Hariharan <eahariha@linux.microsoft.com>
Wed, 19 Feb 2025 21:36:40 +0000 (21:36 +0000)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 7 Apr 2025 18:03:13 +0000 (15:03 -0300)
Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
secs_to_jiffies().  As the value here is a multiple of 1000, use
secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.

This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with
the following Coccinelle rules:

@depends on patch@
expression E;
@@

-msecs_to_jiffies(E * 1000)
+secs_to_jiffies(E)

-msecs_to_jiffies(E * MSEC_PER_SEC)
+secs_to_jiffies(E)

Link: https://patch.msgid.link/r/20250219-rdma-secs-to-jiffies-v1-2-b506746561a9@linux.microsoft.com
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/mr.c

index 5fbebafc87742d918ffcbeb27ec22917185080a7..6dd813bac5b2c392a31109232f6465ab656d001d 100644 (file)
@@ -525,7 +525,7 @@ static void queue_adjust_cache_locked(struct mlx5_cache_ent *ent)
                ent->fill_to_high_water = false;
                if (ent->pending)
                        queue_delayed_work(ent->dev->cache.wq, &ent->dwork,
-                                          msecs_to_jiffies(1000));
+                                          secs_to_jiffies(1));
                else
                        mod_delayed_work(ent->dev->cache.wq, &ent->dwork, 0);
        }
@@ -576,7 +576,7 @@ static void __cache_work_func(struct mlx5_cache_ent *ent)
                                        "add keys command failed, err %d\n",
                                        err);
                                queue_delayed_work(cache->wq, &ent->dwork,
-                                                  msecs_to_jiffies(1000));
+                                                  secs_to_jiffies(1));
                        }
                }
        } else if (ent->mkeys_queue.ci > 2 * ent->limit) {
@@ -2051,7 +2051,7 @@ static int mlx5_revoke_mr(struct mlx5_ib_mr *mr)
                        ent->in_use--;
                if (ent->is_tmp && !ent->tmp_cleanup_scheduled) {
                        mod_delayed_work(ent->dev->cache.wq, &ent->dwork,
-                                        msecs_to_jiffies(30 * 1000));
+                                        secs_to_jiffies(30));
                        ent->tmp_cleanup_scheduled = true;
                }
                spin_unlock_irq(&ent->mkeys_queue.lock);