* [PATCH v3 00/19] Converge on using secs_to_jiffies()
@ 2024-12-10 22:02 Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 01/19] netfilter: conntrack: Cleanup timeout definitions Easwar Hariharan
` (20 more replies)
0 siblings, 21 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan, Jeff Johnson
This is a series that follows up on my previous series to introduce
secs_to_jiffies() and convert a few initial users.[1] In the review for
that series, Anna-Maria requested converting other users with
Coccinelle. [2] This is part 1 that converts users of msecs_to_jiffies()
that use the multiply pattern of either of:
- msecs_to_jiffies(N*1000), or
- msecs_to_jiffies(N*MSEC_PER_SEC)
where N is a constant, to avoid the multiplication.
The entire conversion is made with Coccinelle in the script added in
patch 2. Some changes suggested by Coccinelle have been deferred to
later parts that will address other possible variant patterns.
CC: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
[1] https://lore.kernel.org/all/20241030-open-coded-timeouts-v3-0-9ba123facf88@linux.microsoft.com/
[2] https://lore.kernel.org/all/8734kngfni.fsf@somnus/
---
Changes in v3:
- Rebase on next-20241210
- Fix typo'ed timeout in net/netfilter/nf_conntrack_proto_sctp.c (Stephen Rothwell)
- Use Coccinelle operation modes for Coccinelle script (Markus Elfring)
- Remove redundant comments in arch/arm/mach-pxa/sharpsl_pm.c
(Christophe Leroy)
- Remove excess line breaks (Heiko Carstens, Christophe Leroy)
- Add more detail into the commit messages throughout (Christophe Leroy)
- Pick up Reviewed-by Thomas Hellström for drm/xe
- Drop drm/etnaviv patch already queued into etnaviv/next
- Replace call to [m]secs_to_jiffies(0) with just 0 for livepatch (Dan
Carpenter, Christophe Leroy)
- Split out nfp patch to send to net-next (Christophe Leroy)
- Pick up Acked-by from Jeff Johnson for ath11k
- Link to v2: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v2-0-911fb7595e79@linux.microsoft.com
Changes in v2:
- Exclude already accepted patch adding secs_to_jiffies() https://git.kernel.org/tip/b35108a51cf7bab58d7eace1267d7965978bcdb8
- Link to v1: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v1-0-19aadc34941b@linux.microsoft.com
---
Easwar Hariharan (19):
netfilter: conntrack: Cleanup timeout definitions
coccinelle: misc: Add secs_to_jiffies script
arm: pxa: Convert timeouts to use secs_to_jiffies()
s390: kernel: Convert timeouts to use secs_to_jiffies()
powerpc/papr_scm: Convert timeouts to secs_to_jiffies()
mm: kmemleak: Convert timeouts to secs_to_jiffies()
accel/habanalabs: Convert timeouts to secs_to_jiffies()
drm/xe: Convert timeout to secs_to_jiffies()
scsi: lpfc: Convert timeouts to secs_to_jiffies()
scsi: arcmsr: Convert timeouts to secs_to_jiffies()
scsi: pm8001: Convert timeouts to secs_to_jiffies()
xen/blkback: Convert timeouts to secs_to_jiffies()
gve: Convert timeouts to secs_to_jiffies()
wifi: ath11k: Convert timeouts to secs_to_jiffies()
Bluetooth: MGMT: Convert timeouts to secs_to_jiffies()
staging: vc04_services: Convert timeouts to secs_to_jiffies()
ceph: Convert timeouts to secs_to_jiffies()
livepatch: Convert timeouts to secs_to_jiffies()
ALSA: line6: Convert timeouts to secs_to_jiffies()
arch/arm/mach-pxa/sharpsl_pm.c | 8 ++++----
arch/powerpc/platforms/pseries/papr_scm.c | 2 +-
arch/s390/kernel/lgr.c | 2 +-
arch/s390/kernel/time.c | 4 ++--
arch/s390/kernel/topology.c | 2 +-
drivers/accel/habanalabs/common/device.c | 2 +-
drivers/accel/habanalabs/common/habanalabs_drv.c | 3 +--
drivers/block/xen-blkback/blkback.c | 2 +-
drivers/gpu/drm/xe/xe_device.c | 2 +-
drivers/net/ethernet/google/gve/gve_tx_dqo.c | 6 ++----
drivers/net/wireless/ath/ath11k/debugfs.c | 2 +-
drivers/scsi/arcmsr/arcmsr_hba.c | 2 +-
drivers/scsi/lpfc/lpfc_init.c | 18 +++++++++---------
drivers/scsi/lpfc/lpfc_nportdisc.c | 8 ++++----
drivers/scsi/lpfc/lpfc_nvme.c | 2 +-
drivers/scsi/lpfc/lpfc_sli.c | 4 ++--
drivers/scsi/lpfc/lpfc_vmid.c | 2 +-
drivers/scsi/pm8001/pm8001_init.c | 2 +-
.../vc04_services/bcm2835-audio/bcm2835-vchiq.c | 2 +-
fs/ceph/quota.c | 2 +-
mm/kmemleak.c | 4 ++--
net/bluetooth/mgmt.c | 2 +-
net/netfilter/nf_conntrack_proto_sctp.c | 21 ++++++++-------------
samples/livepatch/livepatch-callbacks-busymod.c | 3 +--
samples/livepatch/livepatch-shadow-fix1.c | 3 +--
samples/livepatch/livepatch-shadow-mod.c | 15 +++++----------
scripts/coccinelle/misc/secs_to_jiffies.cocci | 22 ++++++++++++++++++++++
sound/usb/line6/toneport.c | 2 +-
28 files changed, 78 insertions(+), 71 deletions(-)
---
base-commit: 1b2ab8149928c1cea2d7eca30cd35bb7fe014053
change-id: 20241112-converge-secs-to-jiffies-d99d1016bd11
Best regards,
--
Easwar Hariharan <eahariha@linux.microsoft.com>
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 01/19] netfilter: conntrack: Cleanup timeout definitions
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 02/19] coccinelle: misc: Add secs_to_jiffies script Easwar Hariharan
` (19 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
None of the higher order definitions are used anymore, so remove
definitions for minutes, hours, and days timeouts. Convert the seconds
denominated timeouts to secs_to_jiffies()
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
net/netfilter/nf_conntrack_proto_sctp.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index 4cc97f971264ed779434ab4597dd0162586b3736..7c6f7c9f73320dd208bd0940f539bd9e662e62d0 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -39,20 +39,15 @@ static const char *const sctp_conntrack_names[] = {
[SCTP_CONNTRACK_HEARTBEAT_SENT] = "HEARTBEAT_SENT",
};
-#define SECS * HZ
-#define MINS * 60 SECS
-#define HOURS * 60 MINS
-#define DAYS * 24 HOURS
-
static const unsigned int sctp_timeouts[SCTP_CONNTRACK_MAX] = {
- [SCTP_CONNTRACK_CLOSED] = 10 SECS,
- [SCTP_CONNTRACK_COOKIE_WAIT] = 3 SECS,
- [SCTP_CONNTRACK_COOKIE_ECHOED] = 3 SECS,
- [SCTP_CONNTRACK_ESTABLISHED] = 210 SECS,
- [SCTP_CONNTRACK_SHUTDOWN_SENT] = 3 SECS,
- [SCTP_CONNTRACK_SHUTDOWN_RECD] = 3 SECS,
- [SCTP_CONNTRACK_SHUTDOWN_ACK_SENT] = 3 SECS,
- [SCTP_CONNTRACK_HEARTBEAT_SENT] = 30 SECS,
+ [SCTP_CONNTRACK_CLOSED] = secs_to_jiffies(10),
+ [SCTP_CONNTRACK_COOKIE_WAIT] = secs_to_jiffies(3),
+ [SCTP_CONNTRACK_COOKIE_ECHOED] = secs_to_jiffies(3),
+ [SCTP_CONNTRACK_ESTABLISHED] = secs_to_jiffies(210),
+ [SCTP_CONNTRACK_SHUTDOWN_SENT] = secs_to_jiffies(3),
+ [SCTP_CONNTRACK_SHUTDOWN_RECD] = secs_to_jiffies(3),
+ [SCTP_CONNTRACK_SHUTDOWN_ACK_SENT] = secs_to_jiffies(3),
+ [SCTP_CONNTRACK_HEARTBEAT_SENT] = secs_to_jiffies(30),
};
#define SCTP_FLAG_HEARTBEAT_VTAG_FAILED 1
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 02/19] coccinelle: misc: Add secs_to_jiffies script
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 01/19] netfilter: conntrack: Cleanup timeout definitions Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-17 17:28 ` Alexander Gordeev
2024-12-10 22:02 ` [PATCH v3 03/19] arm: pxa: Convert timeouts to use secs_to_jiffies() Easwar Hariharan
` (18 subsequent siblings)
20 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
This script finds and suggests conversions of timeout patterns that
result in seconds-denominated timeouts to use the new secs_to_jiffies()
API in include/linux/jiffies.h for better readability.
Suggested-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
scripts/coccinelle/misc/secs_to_jiffies.cocci | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci
new file mode 100644
index 0000000000000000000000000000000000000000..8bbb2884ea5db939c63fd4513cf5ca8c977aa8cb
--- /dev/null
+++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0-only
+///
+/// Find usages of:
+/// - msecs_to_jiffies(value*1000)
+/// - msecs_to_jiffies(value*MSEC_PER_SEC)
+///
+// Confidence: High
+// Copyright: (C) 2024 Easwar Hariharan, Microsoft
+// Keywords: secs, seconds, jiffies
+//
+
+virtual patch
+
+@depends on patch@ constant C; @@
+
+- msecs_to_jiffies(C * 1000)
++ secs_to_jiffies(C)
+
+@depends on patch@ constant C; @@
+
+- msecs_to_jiffies(C * MSEC_PER_SEC)
++ secs_to_jiffies(C)
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 03/19] arm: pxa: Convert timeouts to use secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 01/19] netfilter: conntrack: Cleanup timeout definitions Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 02/19] coccinelle: misc: Add secs_to_jiffies script Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 04/19] s390: kernel: " Easwar Hariharan
` (17 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
arch/arm/mach-pxa/sharpsl_pm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 0c8d9000df5a6384d615cf231ff986c0c6b71681..dd930e3a61a493293597815782d2ffd36605a700 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -31,10 +31,10 @@
/*
* Constants
*/
-#define SHARPSL_CHARGE_ON_TIME_INTERVAL (msecs_to_jiffies(1*60*1000)) /* 1 min */
-#define SHARPSL_CHARGE_FINISH_TIME (msecs_to_jiffies(10*60*1000)) /* 10 min */
-#define SHARPSL_BATCHK_TIME (msecs_to_jiffies(15*1000)) /* 15 sec */
-#define SHARPSL_BATCHK_TIME_SUSPEND (60*10) /* 10 min */
+#define SHARPSL_CHARGE_ON_TIME_INTERVAL (secs_to_jiffies(60))
+#define SHARPSL_CHARGE_FINISH_TIME (secs_to_jiffies(10*60))
+#define SHARPSL_BATCHK_TIME (secs_to_jiffies(15))
+#define SHARPSL_BATCHK_TIME_SUSPEND (60*10) /* 10 min */
#define SHARPSL_WAIT_CO_TIME 15 /* 15 sec */
#define SHARPSL_WAIT_DISCHARGE_ON 100 /* 100 msec */
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 04/19] s390: kernel: Convert timeouts to use secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (2 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 03/19] arm: pxa: Convert timeouts to use secs_to_jiffies() Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-17 17:31 ` Alexander Gordeev
2024-12-10 22:02 ` [PATCH v3 05/19] powerpc/papr_scm: Convert timeouts to secs_to_jiffies() Easwar Hariharan
` (16 subsequent siblings)
20 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
secs_to_jiffies(). As the values here are 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 <eahariha@linux.microsoft.com>
---
arch/s390/kernel/lgr.c | 2 +-
arch/s390/kernel/time.c | 4 ++--
arch/s390/kernel/topology.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/s390/kernel/lgr.c b/arch/s390/kernel/lgr.c
index 6652e54cf3db9fbdd8cfb06f8a0dc1d4c05ae7d7..6d1ffca5f798086160112990cb947ec8deed0659 100644
--- a/arch/s390/kernel/lgr.c
+++ b/arch/s390/kernel/lgr.c
@@ -166,7 +166,7 @@ static struct timer_list lgr_timer;
*/
static void lgr_timer_set(void)
{
- mod_timer(&lgr_timer, jiffies + msecs_to_jiffies(LGR_TIMER_INTERVAL_SECS * MSEC_PER_SEC));
+ mod_timer(&lgr_timer, jiffies + secs_to_jiffies(LGR_TIMER_INTERVAL_SECS));
}
/*
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 34a65c141ea076ba97b3238f1f36f077b15961df..e9f47c3a61978a45c72aee23bc44dcb128113c8c 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -662,12 +662,12 @@ static void stp_check_leap(void)
if (ret < 0)
pr_err("failed to set leap second flags\n");
/* arm Timer to clear leap second flags */
- mod_timer(&stp_timer, jiffies + msecs_to_jiffies(14400 * MSEC_PER_SEC));
+ mod_timer(&stp_timer, jiffies + secs_to_jiffies(14400));
} else {
/* The day the leap second is scheduled for hasn't been reached. Retry
* in one hour.
*/
- mod_timer(&stp_timer, jiffies + msecs_to_jiffies(3600 * MSEC_PER_SEC));
+ mod_timer(&stp_timer, jiffies + secs_to_jiffies(3600));
}
}
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 4f9c301a705b63f8dd0e7bc33e7206ad1222e7a7..0fd56a1cadbd4f41a9876a3a3fec7f5dc08ac2db 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -371,7 +371,7 @@ static void set_topology_timer(void)
if (atomic_add_unless(&topology_poll, -1, 0))
mod_timer(&topology_timer, jiffies + msecs_to_jiffies(100));
else
- mod_timer(&topology_timer, jiffies + msecs_to_jiffies(60 * MSEC_PER_SEC));
+ mod_timer(&topology_timer, jiffies + secs_to_jiffies(60));
}
void topology_expect_change(void)
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 05/19] powerpc/papr_scm: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (3 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 04/19] s390: kernel: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-11 7:02 ` Christophe Leroy
2024-12-10 22:02 ` [PATCH v3 06/19] mm: kmemleak: " Easwar Hariharan
` (15 subsequent siblings)
20 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
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))
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 06/19] mm: kmemleak: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (4 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 05/19] powerpc/papr_scm: Convert timeouts to secs_to_jiffies() Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 07/19] accel/habanalabs: " Easwar Hariharan
` (14 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
mm/kmemleak.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 2a945c07ae99525815c8fb733e8eb1b4da60668e..a2ded75cc0c03838bc048c82990c8524f25549b6 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -1855,7 +1855,7 @@ static int kmemleak_scan_thread(void *arg)
* Wait before the first scan to allow the system to fully initialize.
*/
if (first_run) {
- signed long timeout = msecs_to_jiffies(SECS_FIRST_SCAN * 1000);
+ signed long timeout = secs_to_jiffies(SECS_FIRST_SCAN);
first_run = 0;
while (timeout && !kthread_should_stop())
timeout = schedule_timeout_interruptible(timeout);
@@ -2241,7 +2241,7 @@ void __init kmemleak_init(void)
return;
jiffies_min_age = msecs_to_jiffies(MSECS_MIN_AGE);
- jiffies_scan_wait = msecs_to_jiffies(SECS_SCAN_WAIT * 1000);
+ jiffies_scan_wait = secs_to_jiffies(SECS_SCAN_WAIT);
object_cache = KMEM_CACHE(kmemleak_object, SLAB_NOLEAKTRACE);
scan_area_cache = KMEM_CACHE(kmemleak_scan_area, SLAB_NOLEAKTRACE);
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 07/19] accel/habanalabs: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (5 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 06/19] mm: kmemleak: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 08/19] drm/xe: Convert timeout " Easwar Hariharan
` (13 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
drivers/accel/habanalabs/common/device.c | 2 +-
drivers/accel/habanalabs/common/habanalabs_drv.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
index e0cf3b4343bb081638430f2552ed27431b488ff9..30277ae410d4b742ffb7bddc35498564ff96fe62 100644
--- a/drivers/accel/habanalabs/common/device.c
+++ b/drivers/accel/habanalabs/common/device.c
@@ -817,7 +817,7 @@ static void device_hard_reset_pending(struct work_struct *work)
}
queue_delayed_work(hdev->reset_wq, &device_reset_work->reset_work,
- msecs_to_jiffies(HL_PENDING_RESET_PER_SEC * 1000));
+ secs_to_jiffies(HL_PENDING_RESET_PER_SEC));
}
}
diff --git a/drivers/accel/habanalabs/common/habanalabs_drv.c b/drivers/accel/habanalabs/common/habanalabs_drv.c
index 5409b2c656c803f6d172dd882711357061f30022..596c52e8aa266bf48e2be45e719adb202604577b 100644
--- a/drivers/accel/habanalabs/common/habanalabs_drv.c
+++ b/drivers/accel/habanalabs/common/habanalabs_drv.c
@@ -361,8 +361,7 @@ static void fixup_device_params_per_asic(struct hl_device *hdev, int timeout)
* a different default timeout for Gaudi
*/
if (timeout == HL_DEFAULT_TIMEOUT_LOCKED)
- hdev->timeout_jiffies = msecs_to_jiffies(GAUDI_DEFAULT_TIMEOUT_LOCKED *
- MSEC_PER_SEC);
+ hdev->timeout_jiffies = secs_to_jiffies(GAUDI_DEFAULT_TIMEOUT_LOCKED);
hdev->reset_upon_device_release = 0;
break;
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 08/19] drm/xe: Convert timeout to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (6 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 07/19] accel/habanalabs: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 09/19] scsi: lpfc: Convert timeouts " Easwar Hariharan
` (12 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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)
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/gpu/drm/xe/xe_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 56d4ffb650dade8622cc25026a96155fa5572434..9093469a275f46f7bf58ff1049c1c9cc712cdd33 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -519,7 +519,7 @@ static int wait_for_lmem_ready(struct xe_device *xe)
drm_dbg(&xe->drm, "Waiting for lmem initialization\n");
start = jiffies;
- timeout = start + msecs_to_jiffies(60 * 1000); /* 60 sec! */
+ timeout = start + secs_to_jiffies(60); /* 60 sec! */
do {
if (signal_pending(current))
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 09/19] scsi: lpfc: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (7 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 08/19] drm/xe: Convert timeout " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 10/19] scsi: arcmsr: " Easwar Hariharan
` (11 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
drivers/scsi/lpfc/lpfc_init.c | 18 +++++++++---------
drivers/scsi/lpfc/lpfc_nportdisc.c | 8 ++++----
drivers/scsi/lpfc/lpfc_nvme.c | 2 +-
drivers/scsi/lpfc/lpfc_sli.c | 4 ++--
drivers/scsi/lpfc/lpfc_vmid.c | 2 +-
5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 7f57397d91a90d8fea689a6d095c30c974fd63f6..4fed2e1243e05896c7e67902b6a9924bed1a5ea9 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -598,7 +598,7 @@ lpfc_config_port_post(struct lpfc_hba *phba)
jiffies + msecs_to_jiffies(1000 * timeout));
/* Set up heart beat (HB) timer */
mod_timer(&phba->hb_tmofunc,
- jiffies + msecs_to_jiffies(1000 * LPFC_HB_MBOX_INTERVAL));
+ jiffies + secs_to_jiffies(LPFC_HB_MBOX_INTERVAL));
clear_bit(HBA_HBEAT_INP, &phba->hba_flag);
clear_bit(HBA_HBEAT_TMO, &phba->hba_flag);
phba->last_completion_time = jiffies;
@@ -1267,7 +1267,7 @@ lpfc_hb_mbox_cmpl(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq)
!test_bit(FC_UNLOADING, &phba->pport->load_flag))
mod_timer(&phba->hb_tmofunc,
jiffies +
- msecs_to_jiffies(1000 * LPFC_HB_MBOX_INTERVAL));
+ secs_to_jiffies(LPFC_HB_MBOX_INTERVAL));
return;
}
@@ -1555,7 +1555,7 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
/* If IOs are completing, no need to issue a MBX_HEARTBEAT */
spin_lock_irq(&phba->pport->work_port_lock);
if (time_after(phba->last_completion_time +
- msecs_to_jiffies(1000 * LPFC_HB_MBOX_INTERVAL),
+ secs_to_jiffies(LPFC_HB_MBOX_INTERVAL),
jiffies)) {
spin_unlock_irq(&phba->pport->work_port_lock);
if (test_bit(HBA_HBEAT_INP, &phba->hba_flag))
@@ -3354,7 +3354,7 @@ lpfc_block_mgmt_io(struct lpfc_hba *phba, int mbx_action)
spin_unlock_irqrestore(&phba->hbalock, iflag);
if (mbx_action == LPFC_MBX_NO_WAIT)
return;
- timeout = msecs_to_jiffies(LPFC_MBOX_TMO * 1000) + jiffies;
+ timeout = secs_to_jiffies(LPFC_MBOX_TMO) + jiffies;
spin_lock_irqsave(&phba->hbalock, iflag);
if (phba->sli.mbox_active) {
actcmd = phba->sli.mbox_active->u.mb.mbxCommand;
@@ -4924,14 +4924,14 @@ int lpfc_scan_finished(struct Scsi_Host *shost, unsigned long time)
stat = 1;
goto finished;
}
- if (time >= msecs_to_jiffies(30 * 1000)) {
+ if (time >= secs_to_jiffies(30)) {
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"0461 Scanning longer than 30 "
"seconds. Continuing initialization\n");
stat = 1;
goto finished;
}
- if (time >= msecs_to_jiffies(15 * 1000) &&
+ if (time >= secs_to_jiffies(15) &&
phba->link_state <= LPFC_LINK_DOWN) {
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"0465 Link down longer than 15 "
@@ -4945,7 +4945,7 @@ int lpfc_scan_finished(struct Scsi_Host *shost, unsigned long time)
if (vport->num_disc_nodes || vport->fc_prli_sent)
goto finished;
if (!atomic_read(&vport->fc_map_cnt) &&
- time < msecs_to_jiffies(2 * 1000))
+ time < secs_to_jiffies(2))
goto finished;
if ((phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE) != 0)
goto finished;
@@ -5179,8 +5179,8 @@ lpfc_vmid_poll(struct timer_list *t)
lpfc_worker_wake_up(phba);
/* restart the timer for the next iteration */
- mod_timer(&phba->inactive_vmid_poll, jiffies + msecs_to_jiffies(1000 *
- LPFC_VMID_TIMER));
+ mod_timer(&phba->inactive_vmid_poll,
+ jiffies + secs_to_jiffies(LPFC_VMID_TIMER));
}
/**
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index 4d88cfe71caed398d376030c9ae06d3aad6ae00c..08a7f5c6157ff984d6e37751ca5398adbf80b607 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -906,7 +906,7 @@ lpfc_rcv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
(ndlp->nlp_state >= NLP_STE_ADISC_ISSUE ||
ndlp->nlp_state <= NLP_STE_PRLI_ISSUE)) {
mod_timer(&ndlp->nlp_delayfunc,
- jiffies + msecs_to_jiffies(1000 * 1));
+ jiffies + secs_to_jiffies(1));
set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag);
ndlp->nlp_last_elscmd = ELS_CMD_PLOGI;
lpfc_printf_vlog(vport, KERN_INFO,
@@ -1332,7 +1332,7 @@ lpfc_rcv_els_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
}
/* Put ndlp in npr state set plogi timer for 1 sec */
- mod_timer(&ndlp->nlp_delayfunc, jiffies + msecs_to_jiffies(1000 * 1));
+ mod_timer(&ndlp->nlp_delayfunc, jiffies + secs_to_jiffies(1));
set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag);
ndlp->nlp_last_elscmd = ELS_CMD_PLOGI;
ndlp->nlp_prev_state = NLP_STE_PLOGI_ISSUE;
@@ -1936,7 +1936,7 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport,
/* Put ndlp in npr state set plogi timer for 1 sec */
mod_timer(&ndlp->nlp_delayfunc,
- jiffies + msecs_to_jiffies(1000 * 1));
+ jiffies + secs_to_jiffies(1));
set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag);
ndlp->nlp_last_elscmd = ELS_CMD_PLOGI;
@@ -2743,7 +2743,7 @@ lpfc_rcv_prlo_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
if (!test_bit(NLP_DELAY_TMO, &ndlp->nlp_flag)) {
mod_timer(&ndlp->nlp_delayfunc,
- jiffies + msecs_to_jiffies(1000 * 1));
+ jiffies + secs_to_jiffies(1));
set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag);
clear_bit(NLP_NPR_ADISC, &ndlp->nlp_flag);
ndlp->nlp_last_elscmd = ELS_CMD_PLOGI;
diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index 43dc1da4a1567c05d6ac5f8bda19032737998e64..b1adb9f59097d083a3ae24f4ddf6413350a0368d 100644
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -2237,7 +2237,7 @@ lpfc_nvme_lport_unreg_wait(struct lpfc_vport *vport,
* wait. Print a message if a 10 second wait expires and renew the
* wait. This is unexpected.
*/
- wait_tmo = msecs_to_jiffies(LPFC_NVME_WAIT_TMO * 1000);
+ wait_tmo = secs_to_jiffies(LPFC_NVME_WAIT_TMO);
while (true) {
ret = wait_for_completion_timeout(lport_unreg_cmp, wait_tmo);
if (unlikely(!ret)) {
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 874644b31a3ebd815d5bf55bc4b3464c94d9cfa6..3fd9723cd271c8a024b6f34e583668e973404e6f 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -9012,7 +9012,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
/* Start heart beat timer */
mod_timer(&phba->hb_tmofunc,
- jiffies + msecs_to_jiffies(1000 * LPFC_HB_MBOX_INTERVAL));
+ jiffies + secs_to_jiffies(LPFC_HB_MBOX_INTERVAL));
clear_bit(HBA_HBEAT_INP, &phba->hba_flag);
clear_bit(HBA_HBEAT_TMO, &phba->hba_flag);
phba->last_completion_time = jiffies;
@@ -13323,7 +13323,7 @@ lpfc_sli_mbox_sys_shutdown(struct lpfc_hba *phba, int mbx_action)
lpfc_sli_mbox_sys_flush(phba);
return;
}
- timeout = msecs_to_jiffies(LPFC_MBOX_TMO * 1000) + jiffies;
+ timeout = secs_to_jiffies(LPFC_MBOX_TMO) + jiffies;
/* Disable softirqs, including timers from obtaining phba->hbalock */
local_bh_disable();
diff --git a/drivers/scsi/lpfc/lpfc_vmid.c b/drivers/scsi/lpfc/lpfc_vmid.c
index cc3e4736f2fe29e1fd4afe221c9c7c40ecf382d4..14dbfe954e423acc47d1b1c80160ff193783f500 100644
--- a/drivers/scsi/lpfc/lpfc_vmid.c
+++ b/drivers/scsi/lpfc/lpfc_vmid.c
@@ -278,7 +278,7 @@ int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid,
if (!(vport->phba->pport->vmid_flag & LPFC_VMID_TIMER_ENBLD)) {
mod_timer(&vport->phba->inactive_vmid_poll,
jiffies +
- msecs_to_jiffies(1000 * LPFC_VMID_TIMER));
+ secs_to_jiffies(LPFC_VMID_TIMER));
vport->phba->pport->vmid_flag |= LPFC_VMID_TIMER_ENBLD;
}
}
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 10/19] scsi: arcmsr: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (8 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 09/19] scsi: lpfc: Convert timeouts " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 11/19] scsi: pm8001: " Easwar Hariharan
` (10 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
drivers/scsi/arcmsr/arcmsr_hba.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 6a32e3e0d516881fd87a56a394607930582644ee..fe7de7705b7e2c84324f1a493f7825343d6476c6 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -1045,7 +1045,7 @@ static void arcmsr_init_get_devmap_timer(struct AdapterControlBlock *pacb)
static void arcmsr_init_set_datetime_timer(struct AdapterControlBlock *pacb)
{
timer_setup(&pacb->refresh_timer, arcmsr_set_iop_datetime, 0);
- pacb->refresh_timer.expires = jiffies + msecs_to_jiffies(60 * 1000);
+ pacb->refresh_timer.expires = jiffies + secs_to_jiffies(60);
add_timer(&pacb->refresh_timer);
}
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 11/19] scsi: pm8001: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (9 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 10/19] scsi: arcmsr: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 12/19] xen/blkback: " Easwar Hariharan
` (9 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
drivers/scsi/pm8001/pm8001_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index f8c81e53e93f7849bbe7fe9cbc861f22b964bc39..22e0e79e88ab0a60965ff3809de116eb4a6851e2 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -736,7 +736,7 @@ static int pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha)
return -EIO;
}
time_remaining = wait_for_completion_timeout(&completion,
- msecs_to_jiffies(60*1000)); // 1 min
+ secs_to_jiffies(60)); // 1 min
if (!time_remaining) {
kfree(payload.func_specific);
pm8001_dbg(pm8001_ha, FAIL, "get_nvmd_req timeout\n");
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 12/19] xen/blkback: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (10 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 11/19] scsi: pm8001: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 13/19] gve: " Easwar Hariharan
` (8 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
drivers/block/xen-blkback/blkback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index 838064593f62b75f3d937c0c041ea78dedbbaf84..a7c2b04ab943de9cbd69b596aad177a0534f7762 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -544,7 +544,7 @@ static void print_stats(struct xen_blkif_ring *ring)
ring->st_rd_req, ring->st_wr_req,
ring->st_f_req, ring->st_ds_req,
ring->persistent_gnt_c, max_pgrants);
- ring->st_print = jiffies + msecs_to_jiffies(10 * 1000);
+ ring->st_print = jiffies + secs_to_jiffies(10);
ring->st_rd_req = 0;
ring->st_wr_req = 0;
ring->st_oo_req = 0;
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 13/19] gve: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (11 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 12/19] xen/blkback: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 14/19] wifi: ath11k: " Easwar Hariharan
` (7 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
drivers/net/ethernet/google/gve/gve_tx_dqo.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/google/gve/gve_tx_dqo.c b/drivers/net/ethernet/google/gve/gve_tx_dqo.c
index f879426cb5523a7e150f363b5e57b9d472b5817c..394debc62268aadf2579f9b516e045cb48287e7c 100644
--- a/drivers/net/ethernet/google/gve/gve_tx_dqo.c
+++ b/drivers/net/ethernet/google/gve/gve_tx_dqo.c
@@ -1146,8 +1146,7 @@ static void gve_handle_miss_completion(struct gve_priv *priv,
/* jiffies can wraparound but time comparisons can handle overflows. */
pending_packet->timeout_jiffies =
jiffies +
- msecs_to_jiffies(GVE_REINJECT_COMPL_TIMEOUT *
- MSEC_PER_SEC);
+ secs_to_jiffies(GVE_REINJECT_COMPL_TIMEOUT);
add_to_list(tx, &tx->dqo_compl.miss_completions, pending_packet);
*bytes += pending_packet->skb->len;
@@ -1191,8 +1190,7 @@ static void remove_miss_completions(struct gve_priv *priv,
pending_packet->state = GVE_PACKET_STATE_TIMED_OUT_COMPL;
pending_packet->timeout_jiffies =
jiffies +
- msecs_to_jiffies(GVE_DEALLOCATE_COMPL_TIMEOUT *
- MSEC_PER_SEC);
+ secs_to_jiffies(GVE_DEALLOCATE_COMPL_TIMEOUT);
/* Maintain pending packet in another list so the packet can be
* unallocated at a later time.
*/
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 14/19] wifi: ath11k: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (12 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 13/19] gve: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-11 7:42 ` Kalle Valo
2024-12-10 22:02 ` [PATCH v3 15/19] Bluetooth: MGMT: " Easwar Hariharan
` (6 subsequent siblings)
20 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan, Jeff Johnson
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)
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/net/wireless/ath/ath11k/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath11k/debugfs.c b/drivers/net/wireless/ath/ath11k/debugfs.c
index 57281a135dd7fa6b8610636f47873c8bba21053c..bf192529e3fe26a91e72105a77b4c6f849b905ec 100644
--- a/drivers/net/wireless/ath/ath11k/debugfs.c
+++ b/drivers/net/wireless/ath/ath11k/debugfs.c
@@ -178,7 +178,7 @@ static int ath11k_debugfs_fw_stats_request(struct ath11k *ar,
* received 'update stats' event, we keep a 3 seconds timeout in case,
* fw_stats_done is not marked yet
*/
- timeout = jiffies + msecs_to_jiffies(3 * 1000);
+ timeout = jiffies + secs_to_jiffies(3);
ath11k_debugfs_fw_stats_reset(ar);
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 15/19] Bluetooth: MGMT: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (13 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 14/19] wifi: ath11k: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 16/19] staging: vc04_services: " Easwar Hariharan
` (5 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
net/bluetooth/mgmt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index b31192d473d09b663dc7babd107b4894088ebf6d..8c993763ee0f0360e0d92705f9035f47754b793b 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -210,7 +210,7 @@ static const u16 mgmt_untrusted_events[] = {
MGMT_EV_EXP_FEATURE_CHANGED,
};
-#define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000)
+#define CACHE_TIMEOUT secs_to_jiffies(2)
#define ZERO_KEY "\x00\x00\x00\x00\x00\x00\x00\x00" \
"\x00\x00\x00\x00\x00\x00\x00\x00"
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 16/19] staging: vc04_services: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (14 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 15/19] Bluetooth: MGMT: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-11 17:46 ` Dave Stevenson
2024-12-10 22:02 ` [PATCH v3 17/19] ceph: " Easwar Hariharan
` (4 subsequent siblings)
20 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index dc0d715ed97078ad0f0a41db78428db4f4135a76..0dbe76ee557032d7861acfc002cc203ff2e6971d 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -59,7 +59,7 @@ static int bcm2835_audio_send_msg_locked(struct bcm2835_audio_instance *instance
if (wait) {
if (!wait_for_completion_timeout(&instance->msg_avail_comp,
- msecs_to_jiffies(10 * 1000))) {
+ secs_to_jiffies(10))) {
dev_err(instance->dev,
"vchi message timeout, msg=%d\n", m->type);
return -ETIMEDOUT;
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 17/19] ceph: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (15 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 16/19] staging: vc04_services: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 18/19] livepatch: " Easwar Hariharan
` (3 subsequent siblings)
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
fs/ceph/quota.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ceph/quota.c b/fs/ceph/quota.c
index 06ee397e0c3a6172592e62dba95cd267cfff0db1..d90eda19bcc4618f98bfed833c10a6071cf2e2ac 100644
--- a/fs/ceph/quota.c
+++ b/fs/ceph/quota.c
@@ -166,7 +166,7 @@ static struct inode *lookup_quotarealm_inode(struct ceph_mds_client *mdsc,
if (IS_ERR(in)) {
doutc(cl, "Can't lookup inode %llx (err: %ld)\n", realm->ino,
PTR_ERR(in));
- qri->timeout = jiffies + msecs_to_jiffies(60 * 1000); /* XXX */
+ qri->timeout = jiffies + secs_to_jiffies(60); /* XXX */
} else {
qri->timeout = 0;
qri->inode = in;
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 18/19] livepatch: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (16 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 17/19] ceph: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-11 7:00 ` Christophe Leroy
2024-12-10 22:02 ` [PATCH v3 19/19] ALSA: line6: " Easwar Hariharan
` (2 subsequent siblings)
20 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
samples/livepatch/livepatch-callbacks-busymod.c | 3 +--
samples/livepatch/livepatch-shadow-fix1.c | 3 +--
samples/livepatch/livepatch-shadow-mod.c | 15 +++++----------
3 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/samples/livepatch/livepatch-callbacks-busymod.c b/samples/livepatch/livepatch-callbacks-busymod.c
index 378e2d40271a9717d09eff51d3d3612c679736fc..69105596e72e6826aa2815cb2599eea56a0055ba 100644
--- a/samples/livepatch/livepatch-callbacks-busymod.c
+++ b/samples/livepatch/livepatch-callbacks-busymod.c
@@ -44,8 +44,7 @@ static void busymod_work_func(struct work_struct *work)
static int livepatch_callbacks_mod_init(void)
{
pr_info("%s\n", __func__);
- schedule_delayed_work(&work,
- msecs_to_jiffies(1000 * 0));
+ schedule_delayed_work(&work, 0);
return 0;
}
diff --git a/samples/livepatch/livepatch-shadow-fix1.c b/samples/livepatch/livepatch-shadow-fix1.c
index 6701641bf12d454a770e49abeeb0dea92560e55e..f3f153895d6ce751fc91ae1224d91b220cba3e37 100644
--- a/samples/livepatch/livepatch-shadow-fix1.c
+++ b/samples/livepatch/livepatch-shadow-fix1.c
@@ -72,8 +72,7 @@ static struct dummy *livepatch_fix1_dummy_alloc(void)
if (!d)
return NULL;
- d->jiffies_expire = jiffies +
- msecs_to_jiffies(1000 * EXPIRE_PERIOD);
+ d->jiffies_expire = jiffies + secs_to_jiffies(EXPIRE_PERIOD);
/*
* Patch: save the extra memory location into a SV_LEAK shadow
diff --git a/samples/livepatch/livepatch-shadow-mod.c b/samples/livepatch/livepatch-shadow-mod.c
index 7e753b0d2fa611524c9e2adbe02c8fa3e9b6015e..5d83ad5a8118dbbac897dfcbb92e6d5f399d1dc3 100644
--- a/samples/livepatch/livepatch-shadow-mod.c
+++ b/samples/livepatch/livepatch-shadow-mod.c
@@ -101,8 +101,7 @@ static __used noinline struct dummy *dummy_alloc(void)
if (!d)
return NULL;
- d->jiffies_expire = jiffies +
- msecs_to_jiffies(1000 * EXPIRE_PERIOD);
+ d->jiffies_expire = jiffies + secs_to_jiffies(EXPIRE_PERIOD);
/* Oops, forgot to save leak! */
leak = kzalloc(sizeof(*leak), GFP_KERNEL);
@@ -152,8 +151,7 @@ static void alloc_work_func(struct work_struct *work)
list_add(&d->list, &dummy_list);
mutex_unlock(&dummy_list_mutex);
- schedule_delayed_work(&alloc_dwork,
- msecs_to_jiffies(1000 * ALLOC_PERIOD));
+ schedule_delayed_work(&alloc_dwork, secs_to_jiffies(ALLOC_PERIOD));
}
/*
@@ -184,16 +182,13 @@ static void cleanup_work_func(struct work_struct *work)
}
mutex_unlock(&dummy_list_mutex);
- schedule_delayed_work(&cleanup_dwork,
- msecs_to_jiffies(1000 * CLEANUP_PERIOD));
+ schedule_delayed_work(&cleanup_dwork, secs_to_jiffies(CLEANUP_PERIOD));
}
static int livepatch_shadow_mod_init(void)
{
- schedule_delayed_work(&alloc_dwork,
- msecs_to_jiffies(1000 * ALLOC_PERIOD));
- schedule_delayed_work(&cleanup_dwork,
- msecs_to_jiffies(1000 * CLEANUP_PERIOD));
+ schedule_delayed_work(&alloc_dwork, secs_to_jiffies(ALLOC_PERIOD));
+ schedule_delayed_work(&cleanup_dwork, secs_to_jiffies(CLEANUP_PERIOD));
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 19/19] ALSA: line6: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (17 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 18/19] livepatch: " Easwar Hariharan
@ 2024-12-10 22:02 ` Easwar Hariharan
2024-12-10 23:14 ` [PATCH v3 00/19] Converge on using secs_to_jiffies() Jeff Johnson
2024-12-11 0:35 ` Andrew Morton
20 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-10 22:02 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Easwar Hariharan
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 <eahariha@linux.microsoft.com>
---
sound/usb/line6/toneport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/line6/toneport.c b/sound/usb/line6/toneport.c
index ca2c6f5de407ece21ab69a39ed603e3f10069039..c073b38cd6738176fc6a276d05ed553526573341 100644
--- a/sound/usb/line6/toneport.c
+++ b/sound/usb/line6/toneport.c
@@ -386,7 +386,7 @@ static int toneport_setup(struct usb_line6_toneport *toneport)
toneport_update_led(toneport);
schedule_delayed_work(&toneport->line6.startup_work,
- msecs_to_jiffies(TONEPORT_PCM_DELAY * 1000));
+ secs_to_jiffies(TONEPORT_PCM_DELAY));
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (18 preceding siblings ...)
2024-12-10 22:02 ` [PATCH v3 19/19] ALSA: line6: " Easwar Hariharan
@ 2024-12-10 23:14 ` Jeff Johnson
2024-12-10 23:36 ` Andrew Morton
2024-12-11 0:35 ` Andrew Morton
20 siblings, 1 reply; 41+ messages in thread
From: Jeff Johnson @ 2024-12-10 23:14 UTC (permalink / raw)
To: Easwar Hariharan, Pablo Neira Ayuso, Jozsef Kadlecsik,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Julia Lawall, Nicolas Palix, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, Russell King, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, Ofir Bitton, Oded Gabbay, Lucas De Marchi,
Thomas Hellström, Rodrigo Vivi, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jeroen de Borst, Praveen Kaligineedi, Shailend Chand,
Andrew Lunn, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen
On 12/10/2024 2:02 PM, Easwar Hariharan wrote:
> This is a series that follows up on my previous series to introduce
> secs_to_jiffies() and convert a few initial users.[1] In the review for
> that series, Anna-Maria requested converting other users with
> Coccinelle. [2] This is part 1 that converts users of msecs_to_jiffies()
> that use the multiply pattern of either of:
> - msecs_to_jiffies(N*1000), or
> - msecs_to_jiffies(N*MSEC_PER_SEC)
>
> where N is a constant, to avoid the multiplication.
>
> The entire conversion is made with Coccinelle in the script added in
> patch 2. Some changes suggested by Coccinelle have been deferred to
> later parts that will address other possible variant patterns.
>
> CC: Anna-Maria Behnsen <anna-maria@linutronix.de>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
I have the same question as before: How do you expect these to land?
Do you now have a maintainer who will take all of them?
Or do you want individual maintainers to take the ones applicable to them?
/jeff
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-10 23:14 ` [PATCH v3 00/19] Converge on using secs_to_jiffies() Jeff Johnson
@ 2024-12-10 23:36 ` Andrew Morton
2024-12-11 1:35 ` Jakub Kicinski
0 siblings, 1 reply; 41+ messages in thread
From: Andrew Morton @ 2024-12-10 23:36 UTC (permalink / raw)
To: Jeff Johnson
Cc: Easwar Hariharan, Pablo Neira Ayuso, Jozsef Kadlecsik,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Julia Lawall, Nicolas Palix, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, Russell King, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, Ofir Bitton, Oded Gabbay, Lucas De Marchi,
Thomas Hellström, Rodrigo Vivi, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jeroen de Borst, Praveen Kaligineedi, Shailend Chand,
Andrew Lunn, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas, Jack Wang,
Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Xiubo Li, Ilya Dryomov,
Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Jaroslav Kysela, Takashi Iwai, Louis Peens,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N Rao, Madhavan Srinivasan, netfilter-devel, coreteam,
netdev, linux-kernel, cocci, linux-arm-kernel, linux-s390,
dri-devel, intel-xe, linux-scsi, xen-devel, linux-block,
linux-wireless, ath11k, linux-mm, linux-bluetooth, linux-staging,
linux-rpi-kernel, ceph-devel, live-patching, linux-sound,
oss-drivers, linuxppc-dev, Anna-Maria Behnsen
On Tue, 10 Dec 2024 15:14:22 -0800 Jeff Johnson <jeff.johnson@oss.qualcomm.com> wrote:
> On 12/10/2024 2:02 PM, Easwar Hariharan wrote:
> > This is a series that follows up on my previous series to introduce
> > secs_to_jiffies() and convert a few initial users.[1] In the review for
> > that series, Anna-Maria requested converting other users with
> > Coccinelle. [2] This is part 1 that converts users of msecs_to_jiffies()
> > that use the multiply pattern of either of:
> > - msecs_to_jiffies(N*1000), or
> > - msecs_to_jiffies(N*MSEC_PER_SEC)
> >
> > where N is a constant, to avoid the multiplication.
> >
> > The entire conversion is made with Coccinelle in the script added in
> > patch 2. Some changes suggested by Coccinelle have been deferred to
> > later parts that will address other possible variant patterns.
> >
> > CC: Anna-Maria Behnsen <anna-maria@linutronix.de>
> > Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
>
> I have the same question as before: How do you expect these to land?
> Do you now have a maintainer who will take all of them?
> Or do you want individual maintainers to take the ones applicable to them?
I'll just grab everything and see if anyone complains ;)
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
` (19 preceding siblings ...)
2024-12-10 23:14 ` [PATCH v3 00/19] Converge on using secs_to_jiffies() Jeff Johnson
@ 2024-12-11 0:35 ` Andrew Morton
2024-12-11 1:00 ` Easwar Hariharan
20 siblings, 1 reply; 41+ messages in thread
From: Andrew Morton @ 2024-12-11 0:35 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas, Jack Wang,
Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Xiubo Li, Ilya Dryomov,
Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Jaroslav Kysela, Takashi Iwai, Louis Peens,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N Rao, Madhavan Srinivasan, netfilter-devel, coreteam,
netdev, linux-kernel, cocci, linux-arm-kernel, linux-s390,
dri-devel, intel-xe, linux-scsi, xen-devel, linux-block,
linux-wireless, ath11k, linux-mm, linux-bluetooth, linux-staging,
linux-rpi-kernel, ceph-devel, live-patching, linux-sound,
oss-drivers, linuxppc-dev, Anna-Maria Behnsen, Jeff Johnson
On Tue, 10 Dec 2024 22:02:31 +0000 Easwar Hariharan <eahariha@linux.microsoft.com> wrote:
> This is a series that follows up on my previous series to introduce
> secs_to_jiffies() and convert a few initial users.
Thanks, I added this to mm.git. I suppressed the usual added-to-mm
emails because soooo many cc's!
I'd ask relevant maintainers to send in any acks and I'll paste them
into the relevant changelogs.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-11 0:35 ` Andrew Morton
@ 2024-12-11 1:00 ` Easwar Hariharan
2024-12-17 20:53 ` Easwar Hariharan
0 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-11 1:00 UTC (permalink / raw)
To: Andrew Morton
Cc: eahariha, Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas, Jack Wang,
Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Xiubo Li, Ilya Dryomov,
Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Jaroslav Kysela, Takashi Iwai, Louis Peens,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N Rao, Madhavan Srinivasan, netfilter-devel, coreteam,
netdev, linux-kernel, cocci, linux-arm-kernel, linux-s390,
dri-devel, intel-xe, linux-scsi, xen-devel, linux-block,
linux-wireless, ath11k, linux-mm, linux-bluetooth, linux-staging,
linux-rpi-kernel, ceph-devel, live-patching, linux-sound,
oss-drivers, linuxppc-dev, Anna-Maria Behnsen, Jeff Johnson
On 12/10/2024 4:35 PM, Andrew Morton wrote:
> On Tue, 10 Dec 2024 22:02:31 +0000 Easwar Hariharan <eahariha@linux.microsoft.com> wrote:
>
>> This is a series that follows up on my previous series to introduce
>> secs_to_jiffies() and convert a few initial users.
>
> Thanks, I added this to mm.git. I suppressed the usual added-to-mm
> emails because soooo many cc's!
>
> I'd ask relevant maintainers to send in any acks and I'll paste them
> into the relevant changelogs.
Thank you, Andrew!
- Easwar
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-10 23:36 ` Andrew Morton
@ 2024-12-11 1:35 ` Jakub Kicinski
2024-12-11 2:31 ` Andrew Morton
0 siblings, 1 reply; 41+ messages in thread
From: Jakub Kicinski @ 2024-12-11 1:35 UTC (permalink / raw)
To: Andrew Morton, Easwar Hariharan
Cc: Jeff Johnson, Pablo Neira Ayuso, Jozsef Kadlecsik,
David S. Miller, Eric Dumazet, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas, Jack Wang,
Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Xiubo Li, Ilya Dryomov,
Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Jaroslav Kysela, Takashi Iwai, Louis Peens,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N Rao, Madhavan Srinivasan, netfilter-devel, coreteam,
netdev, linux-kernel, cocci, linux-arm-kernel, linux-s390,
dri-devel, intel-xe, linux-scsi, xen-devel, linux-block,
linux-wireless, ath11k, linux-mm, linux-bluetooth, linux-staging,
linux-rpi-kernel, ceph-devel, live-patching, linux-sound,
oss-drivers, linuxppc-dev, Anna-Maria Behnsen
On Tue, 10 Dec 2024 15:36:04 -0800 Andrew Morton wrote:
> > I have the same question as before: How do you expect these to land?
> > Do you now have a maintainer who will take all of them?
> > Or do you want individual maintainers to take the ones applicable to them?
>
> I'll just grab everything and see if anyone complains ;)
I may, if this leads to a conflict :(
Easwar, please break this up per subsystem.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-11 1:35 ` Jakub Kicinski
@ 2024-12-11 2:31 ` Andrew Morton
2024-12-11 2:41 ` Jakub Kicinski
0 siblings, 1 reply; 41+ messages in thread
From: Andrew Morton @ 2024-12-11 2:31 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Easwar Hariharan, Jeff Johnson, Pablo Neira Ayuso,
Jozsef Kadlecsik, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman, Julia Lawall, Nicolas Palix, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, Russell King, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, Ofir Bitton, Oded Gabbay, Lucas De Marchi,
Thomas Hellström, Rodrigo Vivi, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jeroen de Borst, Praveen Kaligineedi, Shailend Chand,
Andrew Lunn, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas, Jack Wang,
Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Xiubo Li, Ilya Dryomov,
Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Jaroslav Kysela, Takashi Iwai, Louis Peens,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N Rao, Madhavan Srinivasan, netfilter-devel, coreteam,
netdev, linux-kernel, cocci, linux-arm-kernel, linux-s390,
dri-devel, intel-xe, linux-scsi, xen-devel, linux-block,
linux-wireless, ath11k, linux-mm, linux-bluetooth, linux-staging,
linux-rpi-kernel, ceph-devel, live-patching, linux-sound,
oss-drivers, linuxppc-dev, Anna-Maria Behnsen
On Tue, 10 Dec 2024 17:35:48 -0800 Jakub Kicinski <kuba@kernel.org> wrote:
> On Tue, 10 Dec 2024 15:36:04 -0800 Andrew Morton wrote:
> > > I have the same question as before: How do you expect these to land?
> > > Do you now have a maintainer who will take all of them?
> > > Or do you want individual maintainers to take the ones applicable to them?
> >
> > I'll just grab everything and see if anyone complains ;)
>
> I may, if this leads to a conflict :(
Very unlikely, and any such conflict will be trivial.
> Easwar, please break this up per subsystem.
The series is already one-patch-per-changed-file.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-11 2:31 ` Andrew Morton
@ 2024-12-11 2:41 ` Jakub Kicinski
2024-12-11 2:50 ` Andrew Morton
2024-12-11 4:34 ` Easwar Hariharan
0 siblings, 2 replies; 41+ messages in thread
From: Jakub Kicinski @ 2024-12-11 2:41 UTC (permalink / raw)
To: Andrew Morton
Cc: Easwar Hariharan, Jeff Johnson, Pablo Neira Ayuso,
Jozsef Kadlecsik, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman, Julia Lawall, Nicolas Palix, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, Russell King, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, Ofir Bitton, Oded Gabbay, Lucas De Marchi,
Thomas Hellström, Rodrigo Vivi, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jeroen de Borst, Praveen Kaligineedi, Shailend Chand,
Andrew Lunn, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas, Jack Wang,
Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Xiubo Li, Ilya Dryomov,
Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Jaroslav Kysela, Takashi Iwai, Louis Peens,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N Rao, Madhavan Srinivasan, netfilter-devel, coreteam,
netdev, linux-kernel, cocci, linux-arm-kernel, linux-s390,
dri-devel, intel-xe, linux-scsi, xen-devel, linux-block,
linux-wireless, ath11k, linux-mm, linux-bluetooth, linux-staging,
linux-rpi-kernel, ceph-devel, live-patching, linux-sound,
oss-drivers, linuxppc-dev, Anna-Maria Behnsen
On Tue, 10 Dec 2024 18:31:30 -0800 Andrew Morton wrote:
> > > I'll just grab everything and see if anyone complains ;)
> >
> > I may, if this leads to a conflict :(
>
> Very unlikely, and any such conflict will be trivial.
Agreed, mainly I don't understand why we'd make an exception
and take the patchset via a special tree.
> > Easwar, please break this up per subsystem.
>
> The series is already one-patch-per-changed-file.
More confusingly still, they did send one standalone patch for
an Ethernet driver:
https://lore.kernel.org/all/20241210-converge-secs-to-jiffies-v3-20-59479891e658@linux.microsoft.com/
And yet another Ethernet driver (drivers/net/ethernet/google/gve/)
is converted in this series.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-11 2:41 ` Jakub Kicinski
@ 2024-12-11 2:50 ` Andrew Morton
2024-12-11 3:01 ` Jakub Kicinski
2024-12-11 4:34 ` Easwar Hariharan
1 sibling, 1 reply; 41+ messages in thread
From: Andrew Morton @ 2024-12-11 2:50 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Easwar Hariharan, Jeff Johnson, Pablo Neira Ayuso,
Jozsef Kadlecsik, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman, Julia Lawall, Nicolas Palix, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, Russell King, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, Ofir Bitton, Oded Gabbay, Lucas De Marchi,
Thomas Hellström, Rodrigo Vivi, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jeroen de Borst, Praveen Kaligineedi, Shailend Chand,
Andrew Lunn, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas, Jack Wang,
Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Xiubo Li, Ilya Dryomov,
Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Jaroslav Kysela, Takashi Iwai, Louis Peens,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N Rao, Madhavan Srinivasan, netfilter-devel, coreteam,
netdev, linux-kernel, cocci, linux-arm-kernel, linux-s390,
dri-devel, intel-xe, linux-scsi, xen-devel, linux-block,
linux-wireless, ath11k, linux-mm, linux-bluetooth, linux-staging,
linux-rpi-kernel, ceph-devel, live-patching, linux-sound,
oss-drivers, linuxppc-dev, Anna-Maria Behnsen
On Tue, 10 Dec 2024 18:41:29 -0800 Jakub Kicinski <kuba@kernel.org> wrote:
> On Tue, 10 Dec 2024 18:31:30 -0800 Andrew Morton wrote:
> > > > I'll just grab everything and see if anyone complains ;)
> > >
> > > I may, if this leads to a conflict :(
> >
> > Very unlikely, and any such conflict will be trivial.
>
> Agreed, mainly I don't understand why we'd make an exception
> and take the patchset via a special tree.
It saves work for everyone?
The patches are super-simple. If a maintainer chooses to merge one of
them, Stephen tells us and I drop the mm.git copy. It's all so easy.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-11 2:50 ` Andrew Morton
@ 2024-12-11 3:01 ` Jakub Kicinski
0 siblings, 0 replies; 41+ messages in thread
From: Jakub Kicinski @ 2024-12-11 3:01 UTC (permalink / raw)
To: Andrew Morton
Cc: Easwar Hariharan, Jeff Johnson, Pablo Neira Ayuso,
Jozsef Kadlecsik, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman, Julia Lawall, Nicolas Palix, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, Russell King, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, Ofir Bitton, Oded Gabbay, Lucas De Marchi,
Thomas Hellström, Rodrigo Vivi, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jeroen de Borst, Praveen Kaligineedi, Shailend Chand,
Andrew Lunn, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas, Jack Wang,
Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Xiubo Li, Ilya Dryomov,
Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Jaroslav Kysela, Takashi Iwai, Louis Peens,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N Rao, Madhavan Srinivasan, netfilter-devel, coreteam,
netdev, linux-kernel, cocci, linux-arm-kernel, linux-s390,
dri-devel, intel-xe, linux-scsi, xen-devel, linux-block,
linux-wireless, ath11k, linux-mm, linux-bluetooth, linux-staging,
linux-rpi-kernel, ceph-devel, live-patching, linux-sound,
oss-drivers, linuxppc-dev, Anna-Maria Behnsen
On Tue, 10 Dec 2024 18:50:40 -0800 Andrew Morton wrote:
> > > Very unlikely, and any such conflict will be trivial.
> >
> > Agreed, mainly I don't understand why we'd make an exception
> > and take the patchset via a special tree.
>
> It saves work for everyone?
>
> The patches are super-simple. If a maintainer chooses to merge one of
> them, Stephen tells us and I drop the mm.git copy. It's all so easy.
If it's just to save work - we're fine.
Please don't apply the networking changes.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-11 2:41 ` Jakub Kicinski
2024-12-11 2:50 ` Andrew Morton
@ 2024-12-11 4:34 ` Easwar Hariharan
1 sibling, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-11 4:34 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Andrew Morton, eahariha, Jeff Johnson, Pablo Neira Ayuso,
Jozsef Kadlecsik, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman, Julia Lawall, Nicolas Palix, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, Russell King, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, Ofir Bitton, Oded Gabbay, Lucas De Marchi,
Thomas Hellström, Rodrigo Vivi, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jeroen de Borst, Praveen Kaligineedi, Shailend Chand,
Andrew Lunn, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas, Jack Wang,
Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Xiubo Li, Ilya Dryomov,
Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Jaroslav Kysela, Takashi Iwai, Louis Peens,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N Rao, Madhavan Srinivasan, netfilter-devel, coreteam,
netdev, linux-kernel, cocci, linux-arm-kernel, linux-s390,
dri-devel, intel-xe, linux-scsi, xen-devel, linux-block,
linux-wireless, ath11k, linux-mm, linux-bluetooth, linux-staging,
linux-rpi-kernel, ceph-devel, live-patching, linux-sound,
oss-drivers, linuxppc-dev, Anna-Maria Behnsen
On 12/10/2024 6:41 PM, Jakub Kicinski wrote:
> On Tue, 10 Dec 2024 18:31:30 -0800 Andrew Morton wrote:
>>>> I'll just grab everything and see if anyone complains ;)
>>>
>>> I may, if this leads to a conflict :(
>>
>> Very unlikely, and any such conflict will be trivial.
>
> Agreed, mainly I don't understand why we'd make an exception
> and take the patchset via a special tree.
>
>>> Easwar, please break this up per subsystem.
>>
>> The series is already one-patch-per-changed-file.
>
> More confusingly still, they did send one standalone patch for
> an Ethernet driver:
> https://lore.kernel.org/all/20241210-converge-secs-to-jiffies-v3-20-59479891e658@linux.microsoft.com/
> And yet another Ethernet driver (drivers/net/ethernet/google/gve/)
> is converted in this series.
Sorry about the confusion, I missed pulling the gve patch from this
series. I'll send that (and ath11k) separately as well. I'll pull all
these together into a series so you can merge them together if you prefer.
Thanks,
Easwar
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 18/19] livepatch: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 ` [PATCH v3 18/19] livepatch: " Easwar Hariharan
@ 2024-12-11 7:00 ` Christophe Leroy
0 siblings, 0 replies; 41+ messages in thread
From: Christophe Leroy @ 2024-12-11 7:00 UTC (permalink / raw)
To: Easwar Hariharan, Pablo Neira Ayuso, Jozsef Kadlecsik,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Julia Lawall, Nicolas Palix, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, Russell King, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, Ofir Bitton, Oded Gabbay, Lucas De Marchi,
Thomas Hellström, Rodrigo Vivi, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jeroen de Borst, Praveen Kaligineedi, Shailend Chand,
Andrew Lunn, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen
Le 10/12/2024 à 23:02, Easwar Hariharan a écrit :
> 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 <eahariha@linux.microsoft.com>
> ---
> samples/livepatch/livepatch-callbacks-busymod.c | 3 +--
> samples/livepatch/livepatch-shadow-fix1.c | 3 +--
> samples/livepatch/livepatch-shadow-mod.c | 15 +++++----------
> 3 files changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/samples/livepatch/livepatch-callbacks-busymod.c b/samples/livepatch/livepatch-callbacks-busymod.c
> index 378e2d40271a9717d09eff51d3d3612c679736fc..69105596e72e6826aa2815cb2599eea56a0055ba 100644
> --- a/samples/livepatch/livepatch-callbacks-busymod.c
> +++ b/samples/livepatch/livepatch-callbacks-busymod.c
> @@ -44,8 +44,7 @@ static void busymod_work_func(struct work_struct *work)
> static int livepatch_callbacks_mod_init(void)
> {
> pr_info("%s\n", __func__);
> - schedule_delayed_work(&work,
> - msecs_to_jiffies(1000 * 0));
> + schedule_delayed_work(&work, 0);
This hunk is not in line with the patch description.
This is probably OK to have in this patch, but you should add additional
description to mention that special case with a 0 delay.
Allthough you should probably change it to schedule_work() instead of
using a 0 delay.
Christophe
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 05/19] powerpc/papr_scm: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 ` [PATCH v3 05/19] powerpc/papr_scm: Convert timeouts to secs_to_jiffies() Easwar Hariharan
@ 2024-12-11 7:02 ` Christophe Leroy
0 siblings, 0 replies; 41+ messages in thread
From: Christophe Leroy @ 2024-12-11 7:02 UTC (permalink / raw)
To: Easwar Hariharan, Pablo Neira Ayuso, Jozsef Kadlecsik,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Julia Lawall, Nicolas Palix, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, Russell King, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, Ofir Bitton, Oded Gabbay, Lucas De Marchi,
Thomas Hellström, Rodrigo Vivi, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jeroen de Borst, Praveen Kaligineedi, Shailend Chand,
Andrew Lunn, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Naveen N Rao, Madhavan Srinivasan
Cc: netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen
Le 10/12/2024 à 23:02, Easwar Hariharan a écrit :
> 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 <eahariha@linux.microsoft.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> 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))
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 14/19] wifi: ath11k: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 ` [PATCH v3 14/19] wifi: ath11k: " Easwar Hariharan
@ 2024-12-11 7:42 ` Kalle Valo
2024-12-11 7:45 ` Kalle Valo
0 siblings, 1 reply; 41+ messages in thread
From: Kalle Valo @ 2024-12-11 7:42 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Jeff Johnson, Catalin Marinas, Andrew Morton,
Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan,
netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Jeff Johnson
Easwar Hariharan <eahariha@linux.microsoft.com> writes:
> 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)
>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> ---
> drivers/net/wireless/ath/ath11k/debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
I assume we can take this to our ath.git tree, please let us know if
that's not the case.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 14/19] wifi: ath11k: Convert timeouts to secs_to_jiffies()
2024-12-11 7:42 ` Kalle Valo
@ 2024-12-11 7:45 ` Kalle Valo
0 siblings, 0 replies; 41+ messages in thread
From: Kalle Valo @ 2024-12-11 7:45 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Jeff Johnson, Catalin Marinas, Andrew Morton,
Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan,
netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen, Jeff Johnson
Kalle Valo <kvalo@kernel.org> writes:
> Easwar Hariharan <eahariha@linux.microsoft.com> writes:
>
>> 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)
>>
>> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
>> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
>> ---
>> drivers/net/wireless/ath/ath11k/debugfs.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> I assume we can take this to our ath.git tree, please let us know if
> that's not the case.
Nevermind, I now saw the discussion in the cover letter and assume that
this patch will be sent separately.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 16/19] staging: vc04_services: Convert timeouts to secs_to_jiffies()
2024-12-10 22:02 ` [PATCH v3 16/19] staging: vc04_services: " Easwar Hariharan
@ 2024-12-11 17:46 ` Dave Stevenson
0 siblings, 0 replies; 41+ messages in thread
From: Dave Stevenson @ 2024-12-11 17:46 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan,
netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen
On Tue, 10 Dec 2024 at 22:02, Easwar Hariharan
<eahariha@linux.microsoft.com> wrote:
>
> 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 <eahariha@linux.microsoft.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> ---
> drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
> index dc0d715ed97078ad0f0a41db78428db4f4135a76..0dbe76ee557032d7861acfc002cc203ff2e6971d 100644
> --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
> +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
> @@ -59,7 +59,7 @@ static int bcm2835_audio_send_msg_locked(struct bcm2835_audio_instance *instance
>
> if (wait) {
> if (!wait_for_completion_timeout(&instance->msg_avail_comp,
> - msecs_to_jiffies(10 * 1000))) {
> + secs_to_jiffies(10))) {
> dev_err(instance->dev,
> "vchi message timeout, msg=%d\n", m->type);
> return -ETIMEDOUT;
>
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 02/19] coccinelle: misc: Add secs_to_jiffies script
2024-12-10 22:02 ` [PATCH v3 02/19] coccinelle: misc: Add secs_to_jiffies script Easwar Hariharan
@ 2024-12-17 17:28 ` Alexander Gordeev
2024-12-17 17:33 ` Julia Lawall
0 siblings, 1 reply; 41+ messages in thread
From: Alexander Gordeev @ 2024-12-17 17:28 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Christian Borntraeger, Sven Schnelle, Ofir Bitton, Oded Gabbay,
Lucas De Marchi, Thomas Hellström, Rodrigo Vivi,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan,
netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen
On Tue, Dec 10, 2024 at 10:02:33PM +0000, Easwar Hariharan wrote:
Hi Easwar,
> This script finds and suggests conversions of timeout patterns that
> result in seconds-denominated timeouts to use the new secs_to_jiffies()
> API in include/linux/jiffies.h for better readability.
>
> Suggested-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> ---
> scripts/coccinelle/misc/secs_to_jiffies.cocci | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> new file mode 100644
> index 0000000000000000000000000000000000000000..8bbb2884ea5db939c63fd4513cf5ca8c977aa8cb
> --- /dev/null
> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> @@ -0,0 +1,22 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +///
> +/// Find usages of:
> +/// - msecs_to_jiffies(value*1000)
> +/// - msecs_to_jiffies(value*MSEC_PER_SEC)
> +///
> +// Confidence: High
> +// Copyright: (C) 2024 Easwar Hariharan, Microsoft
> +// Keywords: secs, seconds, jiffies
> +//
> +
> +virtual patch
> +
> +@depends on patch@ constant C; @@
> +
> +- msecs_to_jiffies(C * 1000)
> ++ secs_to_jiffies(C)
> +
> +@depends on patch@ constant C; @@
> +
> +- msecs_to_jiffies(C * MSEC_PER_SEC)
> ++ secs_to_jiffies(C)
If you used this script only, then it did not seem to recognize line arch/s390/mm/cmm.c:207
mod_timer(&cmm_timer, jiffies + msecs_to_jiffies(cmm_timeout_seconds * MSEC_PER_SEC));
Thanks!
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 04/19] s390: kernel: Convert timeouts to use secs_to_jiffies()
2024-12-10 22:02 ` [PATCH v3 04/19] s390: kernel: " Easwar Hariharan
@ 2024-12-17 17:31 ` Alexander Gordeev
0 siblings, 0 replies; 41+ messages in thread
From: Alexander Gordeev @ 2024-12-17 17:31 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Christian Borntraeger, Sven Schnelle, Ofir Bitton, Oded Gabbay,
Lucas De Marchi, Thomas Hellström, Rodrigo Vivi,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan,
netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen
On Tue, Dec 10, 2024 at 10:02:35PM +0000, Easwar Hariharan wrote:
> Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
> secs_to_jiffies(). As the values here are 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 <eahariha@linux.microsoft.com>
> ---
> arch/s390/kernel/lgr.c | 2 +-
> arch/s390/kernel/time.c | 4 ++--
> arch/s390/kernel/topology.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/s390/kernel/lgr.c b/arch/s390/kernel/lgr.c
> index 6652e54cf3db9fbdd8cfb06f8a0dc1d4c05ae7d7..6d1ffca5f798086160112990cb947ec8deed0659 100644
> --- a/arch/s390/kernel/lgr.c
> +++ b/arch/s390/kernel/lgr.c
> @@ -166,7 +166,7 @@ static struct timer_list lgr_timer;
> */
> static void lgr_timer_set(void)
> {
> - mod_timer(&lgr_timer, jiffies + msecs_to_jiffies(LGR_TIMER_INTERVAL_SECS * MSEC_PER_SEC));
> + mod_timer(&lgr_timer, jiffies + secs_to_jiffies(LGR_TIMER_INTERVAL_SECS));
> }
>
> /*
> diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
> index 34a65c141ea076ba97b3238f1f36f077b15961df..e9f47c3a61978a45c72aee23bc44dcb128113c8c 100644
> --- a/arch/s390/kernel/time.c
> +++ b/arch/s390/kernel/time.c
> @@ -662,12 +662,12 @@ static void stp_check_leap(void)
> if (ret < 0)
> pr_err("failed to set leap second flags\n");
> /* arm Timer to clear leap second flags */
> - mod_timer(&stp_timer, jiffies + msecs_to_jiffies(14400 * MSEC_PER_SEC));
> + mod_timer(&stp_timer, jiffies + secs_to_jiffies(14400));
> } else {
> /* The day the leap second is scheduled for hasn't been reached. Retry
> * in one hour.
> */
> - mod_timer(&stp_timer, jiffies + msecs_to_jiffies(3600 * MSEC_PER_SEC));
> + mod_timer(&stp_timer, jiffies + secs_to_jiffies(3600));
> }
> }
>
> diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
> index 4f9c301a705b63f8dd0e7bc33e7206ad1222e7a7..0fd56a1cadbd4f41a9876a3a3fec7f5dc08ac2db 100644
> --- a/arch/s390/kernel/topology.c
> +++ b/arch/s390/kernel/topology.c
> @@ -371,7 +371,7 @@ static void set_topology_timer(void)
> if (atomic_add_unless(&topology_poll, -1, 0))
> mod_timer(&topology_timer, jiffies + msecs_to_jiffies(100));
> else
> - mod_timer(&topology_timer, jiffies + msecs_to_jiffies(60 * MSEC_PER_SEC));
> + mod_timer(&topology_timer, jiffies + secs_to_jiffies(60));
> }
>
> void topology_expect_change(void)
With this chunk added to the patch:
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index d01724a715d0..7bf0f691827b 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -204,7 +204,7 @@ static void cmm_set_timer(void)
del_timer(&cmm_timer);
return;
}
- mod_timer(&cmm_timer, jiffies + msecs_to_jiffies(cmm_timeout_seconds * MSEC_PER_SEC));
+ mod_timer(&cmm_timer, jiffies + secs_to_jiffies(cmm_timeout_seconds));
}
static void cmm_timer_fn(struct timer_list *unused)
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 02/19] coccinelle: misc: Add secs_to_jiffies script
2024-12-17 17:28 ` Alexander Gordeev
@ 2024-12-17 17:33 ` Julia Lawall
2024-12-17 17:43 ` Easwar Hariharan
0 siblings, 1 reply; 41+ messages in thread
From: Julia Lawall @ 2024-12-17 17:33 UTC (permalink / raw)
To: Alexander Gordeev
Cc: Easwar Hariharan, Pablo Neira Ayuso, Jozsef Kadlecsik,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Julia Lawall, Nicolas Palix, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, Russell King, Heiko Carstens,
Vasily Gorbik, Christian Borntraeger, Sven Schnelle, Ofir Bitton,
Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan,
netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen
On Tue, 17 Dec 2024, Alexander Gordeev wrote:
> On Tue, Dec 10, 2024 at 10:02:33PM +0000, Easwar Hariharan wrote:
>
> Hi Easwar,
>
> > This script finds and suggests conversions of timeout patterns that
> > result in seconds-denominated timeouts to use the new secs_to_jiffies()
> > API in include/linux/jiffies.h for better readability.
> >
> > Suggested-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
> > Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> > ---
> > scripts/coccinelle/misc/secs_to_jiffies.cocci | 22 ++++++++++++++++++++++
> > 1 file changed, 22 insertions(+)
> >
> > diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..8bbb2884ea5db939c63fd4513cf5ca8c977aa8cb
> > --- /dev/null
> > +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> > @@ -0,0 +1,22 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +///
> > +/// Find usages of:
> > +/// - msecs_to_jiffies(value*1000)
> > +/// - msecs_to_jiffies(value*MSEC_PER_SEC)
> > +///
> > +// Confidence: High
> > +// Copyright: (C) 2024 Easwar Hariharan, Microsoft
> > +// Keywords: secs, seconds, jiffies
> > +//
> > +
> > +virtual patch
> > +
> > +@depends on patch@ constant C; @@
> > +
> > +- msecs_to_jiffies(C * 1000)
> > ++ secs_to_jiffies(C)
> > +
> > +@depends on patch@ constant C; @@
> > +
> > +- msecs_to_jiffies(C * MSEC_PER_SEC)
> > ++ secs_to_jiffies(C)
>
> If you used this script only, then it did not seem to recognize line arch/s390/mm/cmm.c:207
>
> mod_timer(&cmm_timer, jiffies + msecs_to_jiffies(cmm_timeout_seconds * MSEC_PER_SEC));
There is the requirement that C is a constant, and cmm_timeout_seconds is
not considered to be a constant, ie it is not all capital letters.
Indeed, it doesn't seem to be a constant at all. I don't know if the
requirement of being a comstant is really necessary.
julia
>
> Thanks!
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 02/19] coccinelle: misc: Add secs_to_jiffies script
2024-12-17 17:33 ` Julia Lawall
@ 2024-12-17 17:43 ` Easwar Hariharan
0 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-17 17:43 UTC (permalink / raw)
To: Julia Lawall, Alexander Gordeev
Cc: eahariha, Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Nicolas Palix, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
Russell King, Heiko Carstens, Vasily Gorbik,
Christian Borntraeger, Sven Schnelle, Ofir Bitton, Oded Gabbay,
Lucas De Marchi, Thomas Hellström, Rodrigo Vivi,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas,
Andrew Morton, Jack Wang, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Greg Kroah-Hartman, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Xiubo Li, Ilya Dryomov, Josh Poimboeuf, Jiri Kosina,
Miroslav Benes, Petr Mladek, Joe Lawrence, Jaroslav Kysela,
Takashi Iwai, Louis Peens, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan,
netfilter-devel, coreteam, netdev, linux-kernel, cocci,
linux-arm-kernel, linux-s390, dri-devel, intel-xe, linux-scsi,
xen-devel, linux-block, linux-wireless, ath11k, linux-mm,
linux-bluetooth, linux-staging, linux-rpi-kernel, ceph-devel,
live-patching, linux-sound, oss-drivers, linuxppc-dev,
Anna-Maria Behnsen
On 12/17/2024 9:33 AM, Julia Lawall wrote:
>
>
> On Tue, 17 Dec 2024, Alexander Gordeev wrote:
>
>> On Tue, Dec 10, 2024 at 10:02:33PM +0000, Easwar Hariharan wrote:
>>
>> Hi Easwar,
>>
>>> This script finds and suggests conversions of timeout patterns that
>>> result in seconds-denominated timeouts to use the new secs_to_jiffies()
>>> API in include/linux/jiffies.h for better readability.
>>>
>>> Suggested-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
>>> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
>>> ---
>>> scripts/coccinelle/misc/secs_to_jiffies.cocci | 22 ++++++++++++++++++++++
>>> 1 file changed, 22 insertions(+)
>>>
>>> diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci
>>> new file mode 100644
>>> index 0000000000000000000000000000000000000000..8bbb2884ea5db939c63fd4513cf5ca8c977aa8cb
>>> --- /dev/null
>>> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
>>> @@ -0,0 +1,22 @@
>>> +// SPDX-License-Identifier: GPL-2.0-only
>>> +///
>>> +/// Find usages of:
>>> +/// - msecs_to_jiffies(value*1000)
>>> +/// - msecs_to_jiffies(value*MSEC_PER_SEC)
>>> +///
>>> +// Confidence: High
>>> +// Copyright: (C) 2024 Easwar Hariharan, Microsoft
>>> +// Keywords: secs, seconds, jiffies
>>> +//
>>> +
>>> +virtual patch
>>> +
>>> +@depends on patch@ constant C; @@
>>> +
>>> +- msecs_to_jiffies(C * 1000)
>>> ++ secs_to_jiffies(C)
>>> +
>>> +@depends on patch@ constant C; @@
>>> +
>>> +- msecs_to_jiffies(C * MSEC_PER_SEC)
>>> ++ secs_to_jiffies(C)
>>
>> If you used this script only, then it did not seem to recognize line arch/s390/mm/cmm.c:207
>>
>> mod_timer(&cmm_timer, jiffies + msecs_to_jiffies(cmm_timeout_seconds * MSEC_PER_SEC));
>
> There is the requirement that C is a constant, and cmm_timeout_seconds is
> not considered to be a constant, ie it is not all capital letters.
> Indeed, it doesn't seem to be a constant at all. I don't know if the
> requirement of being a comstant is really necessary.
>
> julia
>
>>
>> Thanks!
>>
As the cover letter says, this is part 1. I intend to do further parts
that address the cases where the multiplicand is an expression, as well
as the cases where the timeout provided to msecs_to_jiffies() is
denominated in seconds (i.e. ends in 000)
Thanks,
Easwar
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-11 1:00 ` Easwar Hariharan
@ 2024-12-17 20:53 ` Easwar Hariharan
2024-12-17 21:12 ` Andrew Morton
0 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2024-12-17 20:53 UTC (permalink / raw)
To: Andrew Morton
Cc: eahariha, Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas, Jack Wang,
Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Xiubo Li, Ilya Dryomov,
Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Jaroslav Kysela, Takashi Iwai, Louis Peens,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N Rao, Madhavan Srinivasan, netfilter-devel, coreteam,
netdev, linux-kernel, cocci, linux-arm-kernel, linux-s390,
dri-devel, intel-xe, linux-scsi, xen-devel, linux-block,
linux-wireless, ath11k, linux-mm, linux-bluetooth, linux-staging,
linux-rpi-kernel, ceph-devel, live-patching, linux-sound,
oss-drivers, linuxppc-dev, Anna-Maria Behnsen, Jeff Johnson,
paul
On 12/10/2024 5:00 PM, Easwar Hariharan wrote:
> On 12/10/2024 4:35 PM, Andrew Morton wrote:
>> On Tue, 10 Dec 2024 22:02:31 +0000 Easwar Hariharan <eahariha@linux.microsoft.com> wrote:
>>
>>> This is a series that follows up on my previous series to introduce
>>> secs_to_jiffies() and convert a few initial users.
>>
>> Thanks, I added this to mm.git. I suppressed the usual added-to-mm
>> emails because soooo many cc's!
>>
>> I'd ask relevant maintainers to send in any acks and I'll paste them
>> into the relevant changelogs.
>
> Thank you, Andrew!
>
> - Easwar
Hi Andrew,
There have been a couple of comments[1][2] that came in after you queued
the series to mm. Would you rather I send individual patches addressing
these, or just send a v4 of the entire series (-netdev of course) so you
can replace it wholesale?
Thanks,
Easwar
[1]
https://lore.kernel.org/all/07784753-6874-4dda-a080-2d2812f4a10a@csgroup.eu/
[2]
https://lore.kernel.org/all/Z2G1ZPL2cAlQOYlF@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com/
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 00/19] Converge on using secs_to_jiffies()
2024-12-17 20:53 ` Easwar Hariharan
@ 2024-12-17 21:12 ` Andrew Morton
0 siblings, 0 replies; 41+ messages in thread
From: Andrew Morton @ 2024-12-17 21:12 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Julia Lawall, Nicolas Palix, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Russell King, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Ofir Bitton, Oded Gabbay, Lucas De Marchi, Thomas Hellström,
Rodrigo Vivi, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jeroen de Borst,
Praveen Kaligineedi, Shailend Chand, Andrew Lunn, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Roger Pau Monné,
Jens Axboe, Kalle Valo, Jeff Johnson, Catalin Marinas, Jack Wang,
Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Xiubo Li, Ilya Dryomov,
Josh Poimboeuf, Jiri Kosina, Miroslav Benes, Petr Mladek,
Joe Lawrence, Jaroslav Kysela, Takashi Iwai, Louis Peens,
Michael Ellerman, Nicholas Piggin, Christophe Leroy,
Naveen N Rao, Madhavan Srinivasan, netfilter-devel, coreteam,
netdev, linux-kernel, cocci, linux-arm-kernel, linux-s390,
dri-devel, intel-xe, linux-scsi, xen-devel, linux-block,
linux-wireless, ath11k, linux-mm, linux-bluetooth, linux-staging,
linux-rpi-kernel, ceph-devel, live-patching, linux-sound,
oss-drivers, linuxppc-dev, Anna-Maria Behnsen, Jeff Johnson,
paul
On Tue, 17 Dec 2024 12:53:22 -0800 Easwar Hariharan <eahariha@linux.microsoft.com> wrote:
> There have been a couple of comments[1][2] that came in after you queued
> the series to mm. Would you rather I send individual patches addressing
> these, or just send a v4 of the entire series (-netdev of course) so you
> can replace it wholesale?
Individual small fixes would be preferable please. Mainly to
preserve the validity of current review efforts.
^ permalink raw reply [flat|nested] 41+ messages in thread
end of thread, other threads:[~2024-12-17 21:12 UTC | newest]
Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-10 22:02 [PATCH v3 00/19] Converge on using secs_to_jiffies() Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 01/19] netfilter: conntrack: Cleanup timeout definitions Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 02/19] coccinelle: misc: Add secs_to_jiffies script Easwar Hariharan
2024-12-17 17:28 ` Alexander Gordeev
2024-12-17 17:33 ` Julia Lawall
2024-12-17 17:43 ` Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 03/19] arm: pxa: Convert timeouts to use secs_to_jiffies() Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 04/19] s390: kernel: " Easwar Hariharan
2024-12-17 17:31 ` Alexander Gordeev
2024-12-10 22:02 ` [PATCH v3 05/19] powerpc/papr_scm: Convert timeouts to secs_to_jiffies() Easwar Hariharan
2024-12-11 7:02 ` Christophe Leroy
2024-12-10 22:02 ` [PATCH v3 06/19] mm: kmemleak: " Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 07/19] accel/habanalabs: " Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 08/19] drm/xe: Convert timeout " Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 09/19] scsi: lpfc: Convert timeouts " Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 10/19] scsi: arcmsr: " Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 11/19] scsi: pm8001: " Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 12/19] xen/blkback: " Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 13/19] gve: " Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 14/19] wifi: ath11k: " Easwar Hariharan
2024-12-11 7:42 ` Kalle Valo
2024-12-11 7:45 ` Kalle Valo
2024-12-10 22:02 ` [PATCH v3 15/19] Bluetooth: MGMT: " Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 16/19] staging: vc04_services: " Easwar Hariharan
2024-12-11 17:46 ` Dave Stevenson
2024-12-10 22:02 ` [PATCH v3 17/19] ceph: " Easwar Hariharan
2024-12-10 22:02 ` [PATCH v3 18/19] livepatch: " Easwar Hariharan
2024-12-11 7:00 ` Christophe Leroy
2024-12-10 22:02 ` [PATCH v3 19/19] ALSA: line6: " Easwar Hariharan
2024-12-10 23:14 ` [PATCH v3 00/19] Converge on using secs_to_jiffies() Jeff Johnson
2024-12-10 23:36 ` Andrew Morton
2024-12-11 1:35 ` Jakub Kicinski
2024-12-11 2:31 ` Andrew Morton
2024-12-11 2:41 ` Jakub Kicinski
2024-12-11 2:50 ` Andrew Morton
2024-12-11 3:01 ` Jakub Kicinski
2024-12-11 4:34 ` Easwar Hariharan
2024-12-11 0:35 ` Andrew Morton
2024-12-11 1:00 ` Easwar Hariharan
2024-12-17 20:53 ` Easwar Hariharan
2024-12-17 21:12 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox