Thread (39 messages) 39 messages, 8 authors, 2024-12-17

Re: [PATCH v3 05/19] powerpc/papr_scm: Convert timeouts to secs_to_jiffies()

From: Christophe Leroy <hidden>
Date: 2024-12-11 07:02:42
Also in: ath11k, ceph-devel, dri-devel, intel-xe, linux-block, linux-bluetooth, linux-mm, linux-s390, linux-scsi, linux-sound, linux-staging, linux-wireless, live-patching, lkml, netdev, netfilter-devel, xen-devel


Le 10/12/2024 à 23:02, Easwar Hariharan a écrit :
quoted hunk ↗ jump to hunk
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:
@@ constant C; @@

- msecs_to_jiffies(C * 1000)
+ secs_to_jiffies(C)
@@ constant C; @@

- msecs_to_jiffies(C * MSEC_PER_SEC)
+ secs_to_jiffies(C)
Signed-off-by: Easwar Hariharan <redacted>
Reviewed-by: Christophe Leroy <redacted>
quoted hunk ↗ jump to hunk
---
  arch/powerpc/platforms/pseries/papr_scm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c
index f84ac9fbe203c111046464b9100866dddae687bb..f7c9271bda58433f395648063e60409a8d3c11d9 100644
--- a/arch/powerpc/platforms/pseries/papr_scm.c
+++ b/arch/powerpc/platforms/pseries/papr_scm.c
@@ -544,7 +544,7 @@ static int drc_pmem_query_health(struct papr_scm_priv *p)
  
  	/* Jiffies offset for which the health data is assumed to be same */
  	cache_timeout = p->lasthealth_jiffies +
-		msecs_to_jiffies(MIN_HEALTH_QUERY_INTERVAL * 1000);
+		secs_to_jiffies(MIN_HEALTH_QUERY_INTERVAL);
  
  	/* Fetch new health info is its older than MIN_HEALTH_QUERY_INTERVAL */
  	if (time_after(jiffies, cache_timeout))
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help