[PATCH net-next v1] net: amt: convert to use secs_to_jiffies

Yuesong Li posted 1 patch 3 months, 4 weeks ago
drivers/net/amt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH net-next v1] net: amt: convert to use secs_to_jiffies
Posted by Yuesong Li 3 months, 4 weeks ago
Since secs_to_jiffies()(commit:b35108a51cf7) has been introduced, we can
use it to avoid scaling the time to msec.

Signed-off-by: Yuesong Li <liyuesong@vivo.com>
---
 drivers/net/amt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 734a0b3242a9..fb130fde68c0 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -979,7 +979,7 @@ static void amt_event_send_request(struct amt_dev *amt)
 	amt->req_cnt++;
 out:
 	exp = min_t(u32, (1 * (1 << amt->req_cnt)), AMT_MAX_REQ_TIMEOUT);
-	mod_delayed_work(amt_wq, &amt->req_wq, msecs_to_jiffies(exp * 1000));
+	mod_delayed_work(amt_wq, &amt->req_wq, secs_to_jiffies(exp));
 }
 
 static void amt_req_work(struct work_struct *work)
-- 
2.34.1
Re: [PATCH net-next v1] net: amt: convert to use secs_to_jiffies
Posted by Taehee Yoo 3 months, 4 weeks ago
On Fri, Jun 13, 2025 at 7:20 PM Yuesong Li <liyuesong@vivo.com> wrote:
>

Hi Yuesong,
Thanks a lot for your work!

> Since secs_to_jiffies()(commit:b35108a51cf7) has been introduced, we can
> use it to avoid scaling the time to msec.
>
> Signed-off-by: Yuesong Li <liyuesong@vivo.com>

Reviewed-by: Taehee Yoo <ap420073@gmail.com>

Thanks,
Taehee Yoo
Re: [PATCH net-next v1] net: amt: convert to use secs_to_jiffies
Posted by Joe Damato 3 months, 4 weeks ago
On Fri, Jun 13, 2025 at 06:20:12PM +0800, Yuesong Li wrote:
> Since secs_to_jiffies()(commit:b35108a51cf7) has been introduced, we can
> use it to avoid scaling the time to msec.
> 
> Signed-off-by: Yuesong Li <liyuesong@vivo.com>
> ---
>  drivers/net/amt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/amt.c b/drivers/net/amt.c
> index 734a0b3242a9..fb130fde68c0 100644
> --- a/drivers/net/amt.c
> +++ b/drivers/net/amt.c
> @@ -979,7 +979,7 @@ static void amt_event_send_request(struct amt_dev *amt)
>  	amt->req_cnt++;
>  out:
>  	exp = min_t(u32, (1 * (1 << amt->req_cnt)), AMT_MAX_REQ_TIMEOUT);
> -	mod_delayed_work(amt_wq, &amt->req_wq, msecs_to_jiffies(exp * 1000));
> +	mod_delayed_work(amt_wq, &amt->req_wq, secs_to_jiffies(exp));
>  }
>  
>  static void amt_req_work(struct work_struct *work)

Seems fine, but minor nit on the commit message -- when referring to commit
you should include the one-liner as per the documentation [1].

For example, maybe something like:

  Since commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()"), ...

Otherwise:

Reviewed-by: Joe Damato <joe@dama.to>

[1]: https://www.kernel.org/doc/html/v6.15/process/submitting-patches.html