* [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-28 21:02 ` Markus Elfring
2025-01-30 11:01 ` [PATCH 01/16] " Markus Elfring
2025-01-28 18:21 ` [PATCH 02/16] scsi: lpfc: convert timeouts to secs_to_jiffies() Easwar Hariharan
` (15 subsequent siblings)
16 siblings, 2 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, Easwar Hariharan
Teach the script to suggest conversions for timeout patterns where the
arguments to msecs_to_jiffies() are expressions as well.
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
scripts/coccinelle/misc/secs_to_jiffies.cocci | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci
index 8bbb2884ea5db939c63fd4513cf5ca8c977aa8cb..ab9880d239f7d2a8d56a481a2710369e1082e16e 100644
--- a/scripts/coccinelle/misc/secs_to_jiffies.cocci
+++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
@@ -11,12 +11,22 @@
virtual patch
-@depends on patch@ constant C; @@
+@depends on patch@
+constant C;
+@@
-- msecs_to_jiffies(C * 1000)
-+ secs_to_jiffies(C)
+-msecs_to_jiffies
++secs_to_jiffies
+ (C
+- * \( 1000 \| MSEC_PER_SEC \)
+ )
-@depends on patch@ constant C; @@
+@depends on patch@
+expression E;
+@@
-- msecs_to_jiffies(C * MSEC_PER_SEC)
-+ secs_to_jiffies(C)
+-msecs_to_jiffies
++secs_to_jiffies
+ (E
+- * \( 1000 \| MSEC_PER_SEC \)
+ )
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
2025-01-28 18:21 ` [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too Easwar Hariharan
@ 2025-01-28 21:02 ` Markus Elfring
2025-01-29 5:05 ` Easwar Hariharan
2025-01-30 11:01 ` [PATCH 01/16] " Markus Elfring
1 sibling, 1 reply; 41+ messages in thread
From: Markus Elfring @ 2025-01-28 21:02 UTC (permalink / raw)
To: Easwar Hariharan, cocci
Cc: LKML, kernel-janitors, linux-block, linux-btrfs, linux-ide,
linux-nvme, linux-pm, linux-rdma, linux-scsi, linux-sound,
linux-spi, linux-xfs, ceph-devel, platform-driver-x86, dri-devel,
ibm-acpi-devel, imx, kernel, linux-arm-kernel, Andrew Morton,
Carlos Maiolino, Chris Mason, Christoph Hellwig, Damien Le Moal,
Darrick J. Wong, David Sterba, Dick Kennedy, Dongsheng Yang,
Fabio Estevam, Frank Li, Hans de Goede,
Henrique de Moraes Holschuh, James Bottomley, James Smart,
Jaroslav Kysela, Jason Gunthorpe, Jens Axboe, Josef Bacik,
Julia Lawall, Ilpo Järvinen, Ilya Dryomov,
Kalesh Anakkur Purayil, Keith Busch, Leon Romanovsky, Mark Brown,
Martin K. Petersen, Nicolas Palix, Niklas Cassel, Oded Gabbay,
Ricardo Ribalda, Sagi Grimberg, Sascha Hauer, Sebastian Reichel,
Selvin Xavier, Shawn Guo, Shyam Sundar S K, Takashi Iwai,
Victor Gambier, Xiubo Li, Yaron Avizrat
> Teach the script to suggest conversions for timeout patterns where the
> arguments to msecs_to_jiffies() are expressions as well.
I propose to take another look at implementation details for such a script variant
according to the semantic patch language.
…
> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> @@ -11,12 +11,22 @@
>
> virtual patch
…
> -@depends on patch@ constant C; @@
> +@depends on patch@
> +expression E;
> +@@
>
> -- msecs_to_jiffies(C * MSEC_PER_SEC)
> -+ secs_to_jiffies(C)
> +-msecs_to_jiffies
> ++secs_to_jiffies
> + (E
> +- * \( 1000 \| MSEC_PER_SEC \)
> + )
1. I do not see a need to keep an SmPL rule for the handling of constants
(or literals) after the suggested extension for expressions.
2. I find it nice that you indicate an attempt to make the shown SmPL code
a bit more succinct.
Unfortunately, further constraints should be taken better into account
for the current handling of isomorphisms (and corresponding SmPL disjunctions).
Thus I would find an SmPL rule (like the following) more appropriate.
@adjustment@
expression e;
@@
-msecs_to_jiffies
+secs_to_jiffies
(
(
-e * 1000
|
-e * MSEC_PER_SEC
)
+e
)
3. It seems that you would like to support only a single operation mode so far.
This system aspect can trigger further software development challenges.
Regards,
Markus
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
2025-01-28 21:02 ` Markus Elfring
@ 2025-01-29 5:05 ` Easwar Hariharan
2025-01-29 9:40 ` [01/16] " Markus Elfring
0 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-29 5:05 UTC (permalink / raw)
To: Markus Elfring
Cc: cocci, eahariha, LKML, kernel-janitors, linux-block, linux-btrfs,
linux-ide, linux-nvme, linux-pm, linux-rdma, linux-scsi,
linux-sound, linux-spi, linux-xfs, ceph-devel,
platform-driver-x86, dri-devel, ibm-acpi-devel, imx, kernel,
linux-arm-kernel, Andrew Morton, Carlos Maiolino, Chris Mason,
Christoph Hellwig, Damien Le Moal, Darrick J. Wong, David Sterba,
Dick Kennedy, Dongsheng Yang, Fabio Estevam, Frank Li,
Hans de Goede, Henrique de Moraes Holschuh, James Bottomley,
James Smart, Jaroslav Kysela, Jason Gunthorpe, Jens Axboe,
Josef Bacik, Julia Lawall, Ilpo Järvinen, Ilya Dryomov,
Kalesh Anakkur Purayil, Keith Busch, Leon Romanovsky, Mark Brown,
Martin K. Petersen, Nicolas Palix, Niklas Cassel, Oded Gabbay,
Ricardo Ribalda, Sagi Grimberg, Sascha Hauer, Sebastian Reichel,
Selvin Xavier, Shawn Guo, Shyam Sundar S K, Takashi Iwai,
Victor Gambier, Xiubo Li, Yaron Avizrat
On 1/28/2025 1:02 PM, Markus Elfring wrote:
>> Teach the script to suggest conversions for timeout patterns where the
>> arguments to msecs_to_jiffies() are expressions as well.
>
> I propose to take another look at implementation details for such a script variant
> according to the semantic patch language.
>
>
> …
>> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
>> @@ -11,12 +11,22 @@
>>
>> virtual patch
> …
>> -@depends on patch@ constant C; @@
>> +@depends on patch@
>> +expression E;
>> +@@
>>
>> -- msecs_to_jiffies(C * MSEC_PER_SEC)
>> -+ secs_to_jiffies(C)
>> +-msecs_to_jiffies
>> ++secs_to_jiffies
>> + (E
>> +- * \( 1000 \| MSEC_PER_SEC \)
>> + )
>
> 1. I do not see a need to keep an SmPL rule for the handling of constants
> (or literals) after the suggested extension for expressions.
Can you explain why? Would the expression rule also address the cases
where it's a constant or literal?
> 2. I find it nice that you indicate an attempt to make the shown SmPL code
> a bit more succinct.
> Unfortunately, further constraints should be taken better into account
> for the current handling of isomorphisms (and corresponding SmPL disjunctions).
> Thus I would find an SmPL rule (like the following) more appropriate.
>
Sorry, I couldn't follow your sentence construction or reasoning here. I
don't see how my patch is deficient, or different from your suggestion
below, especially given that it follows your feedback from part 1:
https://lore.kernel.org/all/9088f9a2-c4ab-4098-a255-25120df5c497@web.de/
Can you point out specifically what SmPL isomorphisms or disjunctions
are broken with the patch in its current state?
Thanks,
Easwar
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
2025-01-29 5:05 ` Easwar Hariharan
@ 2025-01-29 9:40 ` Markus Elfring
0 siblings, 0 replies; 41+ messages in thread
From: Markus Elfring @ 2025-01-29 9:40 UTC (permalink / raw)
To: Easwar Hariharan, cocci
Cc: LKML, kernel-janitors, linux-block, linux-btrfs, linux-ide,
linux-nvme, linux-pm, linux-rdma, linux-scsi, linux-sound,
linux-spi, linux-xfs, ceph-devel, platform-driver-x86, dri-devel,
ibm-acpi-devel, imx, kernel, linux-arm-kernel, Andrew Morton,
Carlos Maiolino, Chris Mason, Christoph Hellwig, Damien Le Moal,
Darrick J. Wong, David Sterba, Dick Kennedy, Dongsheng Yang,
Fabio Estevam, Frank Li, Hans de Goede,
Henrique de Moraes Holschuh, James Bottomley, James Smart,
Jaroslav Kysela, Jason Gunthorpe, Jens Axboe, Josef Bacik,
Julia Lawall, Ilpo Järvinen, Ilya Dryomov,
Kalesh Anakkur Purayil, Keith Busch, Leon Romanovsky, Mark Brown,
Martin K. Petersen, Nicolas Palix, Niklas Cassel, Oded Gabbay,
Ricardo Ribalda, Sagi Grimberg, Sascha Hauer, Sebastian Reichel,
Selvin Xavier, Shawn Guo, Shyam Sundar S K, Takashi Iwai,
Victor Gambier, Xiubo Li, Yaron Avizrat
>> …
>>> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
>>> @@ -11,12 +11,22 @@
>>>
>>> virtual patch
>> …
>>> -@depends on patch@ constant C; @@
>>> +@depends on patch@
>>> +expression E;
>>> +@@
>>>
>>> -- msecs_to_jiffies(C * MSEC_PER_SEC)
>>> -+ secs_to_jiffies(C)
>>> +-msecs_to_jiffies
>>> ++secs_to_jiffies
>>> + (E
>>> +- * \( 1000 \| MSEC_PER_SEC \)
>>> + )
>>
>> 1. I do not see a need to keep an SmPL rule for the handling of constants
>> (or literals) after the suggested extension for expressions.
>
> Can you explain why? Would the expression rule also address the cases
> where it's a constant or literal?
Probably, yes.
>> 2. I find it nice that you indicate an attempt to make the shown SmPL code
>> a bit more succinct.
>> Unfortunately, further constraints should be taken better into account
>> for the current handling of isomorphisms (and corresponding SmPL disjunctions).
>> Thus I would find an SmPL rule (like the following) more appropriate.
>>
>
> Sorry, I couldn't follow your sentence construction or reasoning here.
> I don't see how my patch is deficient, or different from your suggestion
> below, especially given that it follows your feedback from part 1:
> https://lore.kernel.org/all/9088f9a2-c4ab-4098-a255-25120df5c497@web.de/
I tend also to present possibilities for succinct SmPL code.
Unfortunately, software dependencies can trigger corresponding target conflicts.
> Can you point out specifically what SmPL isomorphisms or disjunctions
> are broken with the patch in its current state?
Please take another look at related information sources.
Would you like to achieve any benefits from commutativity (for multiplications)?
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/bd08cad3f802229dc629a13eefef2018c620e905/standard.iso#L241
https://github.com/coccinelle/coccinelle/blob/cca22217d1b4316224e80a18d0b08dd351234497/standard.iso#L241
Regards,
Markus
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
2025-01-28 18:21 ` [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too Easwar Hariharan
2025-01-28 21:02 ` Markus Elfring
@ 2025-01-30 11:01 ` Markus Elfring
2025-02-01 0:11 ` Easwar Hariharan
1 sibling, 1 reply; 41+ messages in thread
From: Markus Elfring @ 2025-01-30 11:01 UTC (permalink / raw)
To: cocci, kernel-janitors
Cc: LKML, linux-block, linux-btrfs, linux-ide, linux-nvme, linux-pm,
linux-rdma, linux-scsi, linux-sound, linux-spi, linux-xfs,
ceph-devel, platform-driver-x86, dri-devel, ibm-acpi-devel, imx,
kernel, linux-arm-kernel, Andrew Morton, Carlos Maiolino,
Chris Mason, Christoph Hellwig, Damien Le Moal, Darrick J. Wong,
David Sterba, Dick Kennedy, Dongsheng Yang, Easwar Hariharan,
Fabio Estevam, Frank Li, Hans de Goede,
Henrique de Moraes Holschuh, James Bottomley, James Smart,
Jaroslav Kysela, Jason Gunthorpe, Jens Axboe, Josef Bacik,
Julia Lawall, Ilpo Järvinen, Ilya Dryomov,
Kalesh Anakkur Purayil, Keith Busch, Leon Romanovsky, Mark Brown,
Martin K. Petersen, Nicolas Palix, Niklas Cassel, Oded Gabbay,
Ricardo Ribalda, Sagi Grimberg, Sascha Hauer, Sebastian Reichel,
Selvin Xavier, Shawn Guo, Shyam Sundar S K, Takashi Iwai,
Victor Gambier, Xiubo Li, Yaron Avizrat
> Teach the script to suggest conversions for timeout patterns where the
> arguments to msecs_to_jiffies() are expressions as well.
Does anything hinder to benefit any more from a source code analysis approach
(like the following by the extended means of the semantic patch language)?
// SPDX-License-Identifier: GPL-2.0
/// Simplify statements by using a known wrapper macro.
/// Replace selected msecs_to_jiffies() calls by secs_to_jiffies().
//
// Keywords: wrapper macro conversion secs seconds jiffies
// Confidence: High
// Options: --no-includes --include-headers
virtual context, patch, report, org
@depends on context@
expression e;
@@
*msecs_to_jiffies
(
(e * 1000
|e * MSEC_PER_SEC
)
)
@depends on patch@
expression e;
@@
-msecs_to_jiffies
+secs_to_jiffies
(
(
-e * 1000
|
-e * MSEC_PER_SEC
)
+e
)
@x depends on org || report@
expression e;
position p;
@@
msecs_to_jiffies@p
(
(e * 1000
|e * MSEC_PER_SEC
)
)
@script:python depends on org@
p << x.p;
@@
coccilib.org.print_todo(p[0], "WARNING: opportunity for secs_to_jiffies()")
@script:python depends on report@
p << x.p;
@@
coccilib.report.print_report(p[0], "WARNING: opportunity for secs_to_jiffies()")
Regards,
Markus
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
2025-01-30 11:01 ` [PATCH 01/16] " Markus Elfring
@ 2025-02-01 0:11 ` Easwar Hariharan
2025-02-03 7:22 ` [01/16] " Markus Elfring
0 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-02-01 0:11 UTC (permalink / raw)
To: Markus Elfring
Cc: cocci, kernel-janitors, eahariha, LKML, linux-block, linux-btrfs,
linux-ide, linux-nvme, linux-pm, linux-rdma, linux-scsi,
linux-sound, linux-spi, linux-xfs, ceph-devel,
platform-driver-x86, dri-devel, ibm-acpi-devel, imx, kernel,
linux-arm-kernel, Andrew Morton, Carlos Maiolino, Chris Mason,
Christoph Hellwig, Damien Le Moal, Darrick J. Wong, David Sterba,
Dick Kennedy, Dongsheng Yang, Fabio Estevam, Frank Li,
Hans de Goede, Henrique de Moraes Holschuh, James Bottomley,
James Smart, Jaroslav Kysela, Jason Gunthorpe, Jens Axboe,
Josef Bacik, Julia Lawall, Ilpo Järvinen, Ilya Dryomov,
Kalesh Anakkur Purayil, Keith Busch, Leon Romanovsky, Mark Brown,
Martin K. Petersen, Nicolas Palix, Niklas Cassel, Oded Gabbay,
Ricardo Ribalda, Sagi Grimberg, Sascha Hauer, Sebastian Reichel,
Selvin Xavier, Shawn Guo, Shyam Sundar S K, Takashi Iwai,
Victor Gambier, Xiubo Li, Yaron Avizrat, Ricardo Ribalda
On 1/30/2025 3:01 AM, Markus Elfring wrote:
>> Teach the script to suggest conversions for timeout patterns where the
>> arguments to msecs_to_jiffies() are expressions as well.
>
> Does anything hinder to benefit any more from a source code analysis approach
> (like the following by the extended means of the semantic patch language)?
>
Thank you, this is much more useful feedback, specifically due to the
suggested patch below. I did intend to learn about the other modes and
progressively upgrade secs_to_jiffies.cocci with them in the future once
the existing instances were resolved, to help with future code
submissions. The patch below will be super helpful in that.
As it stands, I'll fix up the current rules in v2 following your
suggestion to keep the multiplication in each line to allow Coccinelle
to use the commutativity properties and find more instances.
I'll refrain from implementing the report mode until current instances
have been fixed because of the issue we have already seen[1] with CI
builds being broken. I would not want to break a strict CI build that is
looking for coccicheck REPORT to return 0 results.
[1]:
https://lore.kernel.org/all/20250129-secs_to_jiffles-v1-1-35a5e16b9f03@chromium.org/
<snip>
Thanks,
Easwar (he/him)
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
2025-02-01 0:11 ` Easwar Hariharan
@ 2025-02-03 7:22 ` Markus Elfring
0 siblings, 0 replies; 41+ messages in thread
From: Markus Elfring @ 2025-02-03 7:22 UTC (permalink / raw)
To: Easwar Hariharan, cocci
Cc: kernel-janitors, LKML, linux-block, linux-btrfs, linux-ide,
linux-nvme, linux-pm, linux-rdma, linux-scsi, linux-sound,
linux-spi, linux-xfs, ceph-devel, platform-driver-x86, dri-devel,
ibm-acpi-devel, imx, kernel, linux-arm-kernel, Andrew Morton,
Carlos Maiolino, Chris Mason, Christoph Hellwig, Damien Le Moal,
Darrick J. Wong, David Sterba, Dick Kennedy, Dongsheng Yang,
Fabio Estevam, Frank Li, Hans de Goede,
Henrique de Moraes Holschuh, James Bottomley, James Smart,
Jaroslav Kysela, Jason Gunthorpe, Jens Axboe, Josef Bacik,
Julia Lawall, Ilpo Järvinen, Ilya Dryomov,
Kalesh Anakkur Purayil, Keith Busch, Leon Romanovsky, Mark Brown,
Martin K. Petersen, Nicolas Palix, Niklas Cassel, Oded Gabbay,
Ricardo Ribalda, Sagi Grimberg, Sascha Hauer, Sebastian Reichel,
Selvin Xavier, Shawn Guo, Shyam Sundar S K, Takashi Iwai,
Victor Gambier, Xiubo Li, Yaron Avizrat, Ricardo Ribalda
> As it stands, I'll fix up the current rules in v2 following your
> suggestion to keep the multiplication in each line to allow Coccinelle
> to use the commutativity properties and find more instances.
Corresponding software development challenges can eventually be clarified further.
> I'll refrain from implementing the report mode until current instances
> have been fixed because of the issue we have already seen[1] with CI
> builds being broken. I would not want to break a strict CI build that is
> looking for coccicheck REPORT to return 0 results.
You got into the mood to test support for an information in the software documentation.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/dev-tools/coccinelle.rst?h=v6.13#n92
“…
Note that not all semantic patches implement all modes.
…”
Regards,
Markus
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 02/16] scsi: lpfc: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
2025-01-28 18:21 ` [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-28 18:21 ` [PATCH 03/16] accel/habanalabs: " Easwar Hariharan
` (14 subsequent siblings)
16 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/scsi/lpfc/lpfc_init.c | 4 ++--
drivers/scsi/lpfc/lpfc_scsi.c | 12 +++++-------
drivers/scsi/lpfc/lpfc_sli.c | 24 +++++++++---------------
drivers/scsi/lpfc/lpfc_vport.c | 2 +-
4 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index bcadf11414c8a41d6fc99d03586d55c26d0a6a0f..783ba9c6a81cdc560b8c901d383c3c4d55eedbc7 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -3361,8 +3361,8 @@ lpfc_block_mgmt_io(struct lpfc_hba *phba, int mbx_action)
/* Determine how long we might wait for the active mailbox
* command to be gracefully completed by firmware.
*/
- timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba,
- phba->sli.mbox_active) * 1000) + jiffies;
+ timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba,
+ phba->sli.mbox_active)) + jiffies;
}
spin_unlock_irqrestore(&phba->hbalock, iflag);
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 055ed632c14df51376126a285df728269ca1da6c..f0158fc00f783239db615b0978b6785de064535f 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -5645,9 +5645,8 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
* cmd_flag is set to LPFC_DRIVER_ABORTED before we wait
* for abort to complete.
*/
- wait_event_timeout(waitq,
- (lpfc_cmd->pCmd != cmnd),
- msecs_to_jiffies(2*vport->cfg_devloss_tmo*1000));
+ wait_event_timeout(waitq, (lpfc_cmd->pCmd != cmnd),
+ secs_to_jiffies(2*vport->cfg_devloss_tmo));
spin_lock(&lpfc_cmd->buf_lock);
@@ -5911,7 +5910,7 @@ lpfc_chk_tgt_mapped(struct lpfc_vport *vport, struct fc_rport *rport)
* If target is not in a MAPPED state, delay until
* target is rediscovered or devloss timeout expires.
*/
- later = msecs_to_jiffies(2 * vport->cfg_devloss_tmo * 1000) + jiffies;
+ later = secs_to_jiffies(2 * vport->cfg_devloss_tmo) + jiffies;
while (time_after(later, jiffies)) {
if (!pnode)
return FAILED;
@@ -5957,7 +5956,7 @@ lpfc_reset_flush_io_context(struct lpfc_vport *vport, uint16_t tgt_id,
lpfc_sli_abort_taskmgmt(vport,
&phba->sli.sli3_ring[LPFC_FCP_RING],
tgt_id, lun_id, context);
- later = msecs_to_jiffies(2 * vport->cfg_devloss_tmo * 1000) + jiffies;
+ later = secs_to_jiffies(2 * vport->cfg_devloss_tmo) + jiffies;
while (time_after(later, jiffies) && cnt) {
schedule_timeout_uninterruptible(msecs_to_jiffies(20));
cnt = lpfc_sli_sum_iocb(vport, tgt_id, lun_id, context);
@@ -6137,8 +6136,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd)
wait_event_timeout(waitq,
!test_bit(NLP_WAIT_FOR_LOGO,
&pnode->save_flags),
- msecs_to_jiffies(dev_loss_tmo *
- 1000));
+ secs_to_jiffies(dev_loss_tmo));
if (test_and_clear_bit(NLP_WAIT_FOR_LOGO,
&pnode->save_flags))
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 3fd9723cd271c8a024b6f34e583668e973404e6f..3ccc444c018c51f7c78a8acdb9d12ead8697fbcb 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -9504,8 +9504,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
goto out_not_finished;
}
/* timeout active mbox command */
- timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, pmbox) *
- 1000);
+ timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba, pmbox));
mod_timer(&psli->mbox_tmo, jiffies + timeout);
}
@@ -9629,8 +9628,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
drvr_flag);
goto out_not_finished;
}
- timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, pmbox) *
- 1000) + jiffies;
+ timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba, pmbox)) + jiffies;
i = 0;
/* Wait for command to complete */
while (((word0 & OWN_CHIP) == OWN_CHIP) ||
@@ -9756,9 +9754,8 @@ lpfc_sli4_async_mbox_block(struct lpfc_hba *phba)
* command to be gracefully completed by firmware.
*/
if (phba->sli.mbox_active)
- timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba,
- phba->sli.mbox_active) *
- 1000) + jiffies;
+ timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba,
+ phba->sli.mbox_active)) + jiffies;
spin_unlock_irq(&phba->hbalock);
/* Make sure the mailbox is really active */
@@ -9881,8 +9878,7 @@ lpfc_sli4_wait_bmbx_ready(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
}
}
- timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, mboxq)
- * 1000) + jiffies;
+ timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba, mboxq)) + jiffies;
do {
bmbx_reg.word0 = readl(phba->sli4_hba.BMBXregaddr);
@@ -13159,7 +13155,7 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba *phba,
retval = lpfc_sli_issue_iocb(phba, ring_number, piocb,
SLI_IOCB_RET_IOCB);
if (retval == IOCB_SUCCESS) {
- timeout_req = msecs_to_jiffies(timeout * 1000);
+ timeout_req = secs_to_jiffies(timeout);
timeleft = wait_event_timeout(done_q,
lpfc_chk_iocb_flg(phba, piocb, LPFC_IO_WAKE),
timeout_req);
@@ -13275,8 +13271,7 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq,
/* now issue the command */
retval = lpfc_sli_issue_mbox(phba, pmboxq, MBX_NOWAIT);
if (retval == MBX_BUSY || retval == MBX_SUCCESS) {
- wait_for_completion_timeout(&mbox_done,
- msecs_to_jiffies(timeout * 1000));
+ wait_for_completion_timeout(&mbox_done, secs_to_jiffies(timeout));
spin_lock_irqsave(&phba->hbalock, flag);
pmboxq->ctx_u.mbox_wait = NULL;
@@ -13336,9 +13331,8 @@ lpfc_sli_mbox_sys_shutdown(struct lpfc_hba *phba, int mbx_action)
* command to be gracefully completed by firmware.
*/
if (phba->sli.mbox_active)
- timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba,
- phba->sli.mbox_active) *
- 1000) + jiffies;
+ timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba,
+ phba->sli.mbox_active)) + jiffies;
spin_unlock_irq(&phba->hbalock);
/* Enable softirqs again, done with phba->hbalock */
diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c
index 3d70cc5175730b31eeaf46c89d65c0dc09367d44..cc56a73343195a263c307fab6870a0012899060a 100644
--- a/drivers/scsi/lpfc/lpfc_vport.c
+++ b/drivers/scsi/lpfc/lpfc_vport.c
@@ -246,7 +246,7 @@ static void lpfc_discovery_wait(struct lpfc_vport *vport)
* fabric RA_TOV value and dev_loss tmo. The driver's
* devloss_tmo is 10 giving this loop a 3x multiplier minimally.
*/
- wait_time_max = msecs_to_jiffies(((phba->fc_ratov * 3) + 3) * 1000);
+ wait_time_max = secs_to_jiffies((phba->fc_ratov * 3) + 3);
wait_time_max += jiffies;
start_time = jiffies;
while (time_before(jiffies, wait_time_max)) {
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 03/16] accel/habanalabs: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
2025-01-28 18:21 ` [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too Easwar Hariharan
2025-01-28 18:21 ` [PATCH 02/16] scsi: lpfc: convert timeouts to secs_to_jiffies() Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-28 18:21 ` [PATCH 04/16] ALSA: ac97: " Easwar Hariharan
` (13 subsequent siblings)
16 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/accel/habanalabs/common/command_submission.c | 2 +-
drivers/accel/habanalabs/common/debugfs.c | 2 +-
drivers/accel/habanalabs/common/device.c | 2 +-
drivers/accel/habanalabs/common/habanalabs_drv.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common/command_submission.c
index 59823e3c3bf7a4fafc0b112fd7b4b2209149973c..dee487724918554c24c3e78df4e8715dd1c73acd 100644
--- a/drivers/accel/habanalabs/common/command_submission.c
+++ b/drivers/accel/habanalabs/common/command_submission.c
@@ -2586,7 +2586,7 @@ int hl_cs_ioctl(struct drm_device *ddev, void *data, struct drm_file *file_priv)
cs_seq = args->in.seq;
timeout = flags & HL_CS_FLAGS_CUSTOM_TIMEOUT
- ? msecs_to_jiffies(args->in.timeout * 1000)
+ ? secs_to_jiffies(args->in.timeout)
: hpriv->hdev->timeout_jiffies;
switch (cs_type) {
diff --git a/drivers/accel/habanalabs/common/debugfs.c b/drivers/accel/habanalabs/common/debugfs.c
index ca7677293a55822f703a3a1cbf947c4c44fdc569..4b391807e5f2e2a2570a38b9dfdf6be4299dbfb6 100644
--- a/drivers/accel/habanalabs/common/debugfs.c
+++ b/drivers/accel/habanalabs/common/debugfs.c
@@ -1403,7 +1403,7 @@ static ssize_t hl_timeout_locked_write(struct file *f, const char __user *buf,
return rc;
if (value)
- hdev->timeout_jiffies = msecs_to_jiffies(value * 1000);
+ hdev->timeout_jiffies = secs_to_jiffies(value);
else
hdev->timeout_jiffies = MAX_SCHEDULE_TIMEOUT;
diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
index 30277ae410d4b742ffb7bddc35498564ff96fe62..68eebed3b050f72f81e55b86da869b56b4cdeadf 100644
--- a/drivers/accel/habanalabs/common/device.c
+++ b/drivers/accel/habanalabs/common/device.c
@@ -2091,7 +2091,7 @@ int hl_device_cond_reset(struct hl_device *hdev, u32 flags, u64 event_mask)
dev_dbg(hdev->dev, "Device is going to be hard-reset in %u sec unless being released\n",
hdev->device_release_watchdog_timeout_sec);
schedule_delayed_work(&hdev->device_release_watchdog_work.reset_work,
- msecs_to_jiffies(hdev->device_release_watchdog_timeout_sec * 1000));
+ secs_to_jiffies(hdev->device_release_watchdog_timeout_sec));
hdev->reset_info.watchdog_active = 1;
out:
spin_unlock(&hdev->reset_info.lock);
diff --git a/drivers/accel/habanalabs/common/habanalabs_drv.c b/drivers/accel/habanalabs/common/habanalabs_drv.c
index 596c52e8aa266bf48e2be45e719adb202604577b..0035748f3228246da235f227b2cf3939d64af350 100644
--- a/drivers/accel/habanalabs/common/habanalabs_drv.c
+++ b/drivers/accel/habanalabs/common/habanalabs_drv.c
@@ -386,7 +386,7 @@ static int fixup_device_params(struct hl_device *hdev)
hdev->fw_comms_poll_interval_usec = HL_FW_STATUS_POLL_INTERVAL_USEC;
if (tmp_timeout)
- hdev->timeout_jiffies = msecs_to_jiffies(tmp_timeout * MSEC_PER_SEC);
+ hdev->timeout_jiffies = secs_to_jiffies(tmp_timeout);
else
hdev->timeout_jiffies = MAX_SCHEDULE_TIMEOUT;
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 04/16] ALSA: ac97: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (2 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 03/16] accel/habanalabs: " Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-29 9:46 ` Takashi Iwai
2025-01-28 18:21 ` [PATCH 05/16] btrfs: " Easwar Hariharan
` (12 subsequent siblings)
16 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
sound/pci/ac97/ac97_codec.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 6e710dce5c6068ec20c2da751b6f5372ad1df211..88ac37739b7653f69af430dd0163f5ab4ddf0d0c 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -2461,8 +2461,7 @@ int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup)
* (for avoiding loud click noises for many (OSS) apps
* that open/close frequently)
*/
- schedule_delayed_work(&ac97->power_work,
- msecs_to_jiffies(power_save * 1000));
+ schedule_delayed_work(&ac97->power_work, secs_to_jiffies(power_save));
else {
cancel_delayed_work(&ac97->power_work);
update_power_regs(ac97);
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 04/16] ALSA: ac97: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 ` [PATCH 04/16] ALSA: ac97: " Easwar Hariharan
@ 2025-01-29 9:46 ` Takashi Iwai
0 siblings, 0 replies; 41+ messages in thread
From: Takashi Iwai @ 2025-01-29 9:46 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky, cocci, linux-kernel, linux-scsi,
dri-devel, linux-sound, linux-btrfs, ceph-devel, linux-block,
linux-ide, linux-xfs, linux-pm, linux-nvme, linux-spi, imx,
linux-arm-kernel, platform-driver-x86, ibm-acpi-devel, linux-rdma
On Tue, 28 Jan 2025 19:21:49 +0100,
Easwar Hariharan 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:
>
> @depends on patch@
> expression E;
> @@
>
> -msecs_to_jiffies
> +secs_to_jiffies
> (E
> - * \( 1000 \| MSEC_PER_SEC \)
> )
>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
thanks,
Takashi
> ---
> sound/pci/ac97/ac97_codec.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
> index 6e710dce5c6068ec20c2da751b6f5372ad1df211..88ac37739b7653f69af430dd0163f5ab4ddf0d0c 100644
> --- a/sound/pci/ac97/ac97_codec.c
> +++ b/sound/pci/ac97/ac97_codec.c
> @@ -2461,8 +2461,7 @@ int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup)
> * (for avoiding loud click noises for many (OSS) apps
> * that open/close frequently)
> */
> - schedule_delayed_work(&ac97->power_work,
> - msecs_to_jiffies(power_save * 1000));
> + schedule_delayed_work(&ac97->power_work, secs_to_jiffies(power_save));
> else {
> cancel_delayed_work(&ac97->power_work);
> update_power_regs(ac97);
>
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 05/16] btrfs: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (3 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 04/16] ALSA: ac97: " Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-28 19:28 ` David Sterba
2025-01-28 18:21 ` [PATCH 06/16] rbd: " Easwar Hariharan
` (11 subsequent siblings)
16 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
fs/btrfs/disk-io.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index f09db62e61a1b0e2b8b319f9605883fe0c86cf9d..ed2772d2791997b1e1d15e71d01d818b325f5173 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1568,7 +1568,7 @@ static int transaction_kthread(void *arg)
do {
cannot_commit = false;
- delay = msecs_to_jiffies(fs_info->commit_interval * 1000);
+ delay = secs_to_jiffies(fs_info->commit_interval);
mutex_lock(&fs_info->transaction_kthread_mutex);
spin_lock(&fs_info->trans_lock);
@@ -1583,9 +1583,9 @@ static int transaction_kthread(void *arg)
cur->state < TRANS_STATE_COMMIT_PREP &&
delta < fs_info->commit_interval) {
spin_unlock(&fs_info->trans_lock);
- delay -= msecs_to_jiffies((delta - 1) * 1000);
+ delay -= secs_to_jiffies(delta - 1);
delay = min(delay,
- msecs_to_jiffies(fs_info->commit_interval * 1000));
+ secs_to_jiffies(fs_info->commit_interval));
goto sleep;
}
transid = cur->transid;
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 05/16] btrfs: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 ` [PATCH 05/16] btrfs: " Easwar Hariharan
@ 2025-01-28 19:28 ` David Sterba
0 siblings, 0 replies; 41+ messages in thread
From: David Sterba @ 2025-01-28 19:28 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky, cocci, linux-kernel, linux-scsi,
dri-devel, linux-sound, linux-btrfs, ceph-devel, linux-block,
linux-ide, linux-xfs, linux-pm, linux-nvme, linux-spi, imx,
linux-arm-kernel, platform-driver-x86, ibm-acpi-devel, linux-rdma
On Tue, Jan 28, 2025 at 06:21:50PM +0000, Easwar Hariharan 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:
>
> @depends on patch@
> expression E;
> @@
>
> -msecs_to_jiffies
> +secs_to_jiffies
> (E
> - * \( 1000 \| MSEC_PER_SEC \)
> )
>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Acked-by: David Sterba <dsterba@suse.com>
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 06/16] rbd: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (4 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 05/16] btrfs: " Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-29 21:03 ` Easwar Hariharan
2025-01-28 18:21 ` [PATCH 07/16] libceph: " Easwar Hariharan
` (10 subsequent siblings)
16 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/block/rbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 5b393e4a1ddfc4eba1a821b9bf8e04585bdf2190..c2389500076643b8e1e9caa75431693d12e59a5e 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4162,7 +4162,7 @@ static void rbd_acquire_lock(struct work_struct *work)
dout("%s rbd_dev %p requeuing lock_dwork\n", __func__,
rbd_dev);
mod_delayed_work(rbd_dev->task_wq, &rbd_dev->lock_dwork,
- msecs_to_jiffies(2 * RBD_NOTIFY_TIMEOUT * MSEC_PER_SEC));
+ secs_to_jiffies(2 * RBD_NOTIFY_TIMEOUT));
}
}
@@ -6283,9 +6283,9 @@ static int rbd_parse_param(struct fs_parameter *param,
break;
case Opt_lock_timeout:
/* 0 is "wait forever" (i.e. infinite timeout) */
- if (result.uint_32 > INT_MAX / 1000)
+ if (result.uint_32 > INT_MAX)
goto out_of_range;
- opt->lock_timeout = msecs_to_jiffies(result.uint_32 * 1000);
+ opt->lock_timeout = secs_to_jiffies(result.uint_32);
break;
case Opt_pool_ns:
kfree(pctx->spec->pool_ns);
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 06/16] rbd: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 ` [PATCH 06/16] rbd: " Easwar Hariharan
@ 2025-01-29 21:03 ` Easwar Hariharan
2025-02-03 21:19 ` Ilya Dryomov
0 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-29 21:03 UTC (permalink / raw)
To: Andrew Morton, Ilya Dryomov, Dongsheng Yang, Jens Axboe,
ceph-devel, linux-block
Cc: Yaron Avizrat, Oded Gabbay, Julia Lawall, Nicolas Palix,
James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Xiubo Li, Damien Le Moal,
Niklas Cassel, Carlos Maiolino, Darrick J. Wong,
Sebastian Reichel, Keith Busch, Christoph Hellwig, Sagi Grimberg,
Frank Li, Mark Brown, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Shyam Sundar S K,
Hans de Goede, Ilpo Järvinen, Henrique de Moraes Holschuh,
Selvin Xavier, Kalesh AP, Jason Gunthorpe, Leon Romanovsky,
eahariha, cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, linux-ide, linux-xfs, linux-pm, linux-nvme,
linux-spi, imx, linux-arm-kernel, platform-driver-x86,
ibm-acpi-devel, linux-rdma
On 1/28/2025 10:21 AM, Easwar Hariharan 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:
>
> @depends on patch@
> expression E;
> @@
>
> -msecs_to_jiffies
> +secs_to_jiffies
> (E
> - * \( 1000 \| MSEC_PER_SEC \)
> )
>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> ---
> drivers/block/rbd.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
<snip>
> @@ -6283,9 +6283,9 @@ static int rbd_parse_param(struct fs_parameter *param,
> break;
> case Opt_lock_timeout:
> /* 0 is "wait forever" (i.e. infinite timeout) */
> - if (result.uint_32 > INT_MAX / 1000)
> + if (result.uint_32 > INT_MAX)
> goto out_of_range;
> - opt->lock_timeout = msecs_to_jiffies(result.uint_32 * 1000);
> + opt->lock_timeout = secs_to_jiffies(result.uint_32);
> break;
> case Opt_pool_ns:
> kfree(pctx->spec->pool_ns);
>
Hi Ilya, Dongsheng, Jens, others,
Could you please review this hunk and confirm the correct range check
here? I figure this is here because of the multiplier to
msecs_to_jiffies() and therefore unneeded after the conversion. If so, I
noticed patch 07 has similar range checks that I neglected to fix and
can do in a v2.
Thanks,
Easwar (he/him)
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 06/16] rbd: convert timeouts to secs_to_jiffies()
2025-01-29 21:03 ` Easwar Hariharan
@ 2025-02-03 21:19 ` Ilya Dryomov
0 siblings, 0 replies; 41+ messages in thread
From: Ilya Dryomov @ 2025-02-03 21:19 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Andrew Morton, Dongsheng Yang, Jens Axboe, ceph-devel,
linux-block, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Xiubo Li, Damien Le Moal,
Niklas Cassel, Carlos Maiolino, Darrick J. Wong,
Sebastian Reichel, Keith Busch, Christoph Hellwig, Sagi Grimberg,
Frank Li, Mark Brown, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Shyam Sundar S K,
Hans de Goede, Ilpo Järvinen, Henrique de Moraes Holschuh,
Selvin Xavier, Kalesh AP, Jason Gunthorpe, Leon Romanovsky, cocci,
linux-kernel, linux-scsi, dri-devel, linux-sound, linux-btrfs,
linux-ide, linux-xfs, linux-pm, linux-nvme, linux-spi, imx,
linux-arm-kernel, platform-driver-x86, ibm-acpi-devel, linux-rdma
On Wed, Jan 29, 2025 at 10:03 PM Easwar Hariharan
<eahariha@linux.microsoft.com> wrote:
>
> On 1/28/2025 10:21 AM, Easwar Hariharan 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:
> >
> > @depends on patch@
> > expression E;
> > @@
> >
> > -msecs_to_jiffies
> > +secs_to_jiffies
> > (E
> > - * \( 1000 \| MSEC_PER_SEC \)
> > )
> >
> > Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> > ---
> > drivers/block/rbd.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
>
> <snip>
>
> > @@ -6283,9 +6283,9 @@ static int rbd_parse_param(struct fs_parameter *param,
> > break;
> > case Opt_lock_timeout:
> > /* 0 is "wait forever" (i.e. infinite timeout) */
> > - if (result.uint_32 > INT_MAX / 1000)
> > + if (result.uint_32 > INT_MAX)
> > goto out_of_range;
> > - opt->lock_timeout = msecs_to_jiffies(result.uint_32 * 1000);
> > + opt->lock_timeout = secs_to_jiffies(result.uint_32);
> > break;
> > case Opt_pool_ns:
> > kfree(pctx->spec->pool_ns);
> >
>
> Hi Ilya, Dongsheng, Jens, others,
>
> Could you please review this hunk and confirm the correct range check
> here? I figure this is here because of the multiplier to
> msecs_to_jiffies() and therefore unneeded after the conversion. If so, I
Hi Easwar,
I'm not sure why INT_MAX / 1000 was used for an option which is defined
as fsparam_u32 and accessed through result.uint_32, but yes, this check
appears to be unneeded after the conversion to me.
> noticed patch 07 has similar range checks that I neglected to fix and
> can do in a v2.
Go ahead but note that two of them also reject 0 -- that part needs to
stay ;)
Thanks,
Ilya
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 07/16] libceph: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (5 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 06/16] rbd: " Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-28 18:21 ` [PATCH 08/16] libata: zpodd: " Easwar Hariharan
` (9 subsequent siblings)
16 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
net/ceph/ceph_common.c | 10 ++++------
net/ceph/osd_client.c | 3 +--
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 4c6441536d55b6323f4b9d93b5d4837cd4ec880c..0d1e303c0212cc9f70f7c54ca422b0b3ea01bf32 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -529,27 +529,25 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
/* 0 isn't well defined right now, reject it */
if (result.uint_32 < 1 || result.uint_32 > INT_MAX / 1000)
goto out_of_range;
- opt->osd_keepalive_timeout =
- msecs_to_jiffies(result.uint_32 * 1000);
+ opt->osd_keepalive_timeout = secs_to_jiffies(result.uint_32);
break;
case Opt_osd_idle_ttl:
/* 0 isn't well defined right now, reject it */
if (result.uint_32 < 1 || result.uint_32 > INT_MAX / 1000)
goto out_of_range;
- opt->osd_idle_ttl = msecs_to_jiffies(result.uint_32 * 1000);
+ opt->osd_idle_ttl = secs_to_jiffies(result.uint_32);
break;
case Opt_mount_timeout:
/* 0 is "wait forever" (i.e. infinite timeout) */
if (result.uint_32 > INT_MAX / 1000)
goto out_of_range;
- opt->mount_timeout = msecs_to_jiffies(result.uint_32 * 1000);
+ opt->mount_timeout = secs_to_jiffies(result.uint_32);
break;
case Opt_osd_request_timeout:
/* 0 is "wait forever" (i.e. infinite timeout) */
if (result.uint_32 > INT_MAX / 1000)
goto out_of_range;
- opt->osd_request_timeout =
- msecs_to_jiffies(result.uint_32 * 1000);
+ opt->osd_request_timeout = secs_to_jiffies(result.uint_32);
break;
case Opt_share:
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index b24afec241382b60d775dd12a6561fa23a7eca45..ba61a48b4388c2eceb5b7a299906e7f90191dd5d 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -4989,8 +4989,7 @@ int ceph_osdc_notify(struct ceph_osd_client *osdc,
linger_submit(lreq);
ret = linger_reg_commit_wait(lreq);
if (!ret)
- ret = linger_notify_finish_wait(lreq,
- msecs_to_jiffies(2 * timeout * MSEC_PER_SEC));
+ ret = linger_notify_finish_wait(lreq, secs_to_jiffies(2 * timeout));
else
dout("lreq %p failed to initiate notify %d\n", lreq, ret);
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 08/16] libata: zpodd: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (6 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 07/16] libceph: " Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-29 0:21 ` Damien Le Moal
2025-01-28 18:21 ` [PATCH 09/16] xfs: " Easwar Hariharan
` (8 subsequent siblings)
16 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/ata/libata-zpodd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c
index 4b83b517caec66c82b126666f6dffd09729bf845..799531218ea2d5cc1b7e693a2b2aff7f376f7d76 100644
--- a/drivers/ata/libata-zpodd.c
+++ b/drivers/ata/libata-zpodd.c
@@ -160,8 +160,7 @@ void zpodd_on_suspend(struct ata_device *dev)
return;
}
- expires = zpodd->last_ready +
- msecs_to_jiffies(zpodd_poweroff_delay * 1000);
+ expires = zpodd->last_ready + secs_to_jiffies(zpodd_poweroff_delay);
if (time_before(jiffies, expires))
return;
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 08/16] libata: zpodd: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 ` [PATCH 08/16] libata: zpodd: " Easwar Hariharan
@ 2025-01-29 0:21 ` Damien Le Moal
2025-01-29 17:36 ` Easwar Hariharan
0 siblings, 1 reply; 41+ messages in thread
From: Damien Le Moal @ 2025-01-29 0:21 UTC (permalink / raw)
To: Easwar Hariharan, Andrew Morton, Yaron Avizrat, Oded Gabbay,
Julia Lawall, Nicolas Palix, James Smart, Dick Kennedy,
James E.J. Bottomley, Martin K. Petersen, Jaroslav Kysela,
Takashi Iwai, Chris Mason, Josef Bacik, David Sterba,
Ilya Dryomov, Dongsheng Yang, Jens Axboe, Xiubo Li, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma
On 1/29/25 3:21 AM, Easwar Hariharan 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:
>
> @depends on patch@
> expression E;
> @@
>
> -msecs_to_jiffies
> +secs_to_jiffies
> (E
> - * \( 1000 \| MSEC_PER_SEC \)
> )
>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
The subject line should be:
ata: libata-zpodd: convert timeouts to secs_to_jiffies()
Other than that, looks good to me.
Acked-by: Damien Le Moal <dlemoal@kernel.org>
> ---
> drivers/ata/libata-zpodd.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c
> index 4b83b517caec66c82b126666f6dffd09729bf845..799531218ea2d5cc1b7e693a2b2aff7f376f7d76 100644
> --- a/drivers/ata/libata-zpodd.c
> +++ b/drivers/ata/libata-zpodd.c
> @@ -160,8 +160,7 @@ void zpodd_on_suspend(struct ata_device *dev)
> return;
> }
>
> - expires = zpodd->last_ready +
> - msecs_to_jiffies(zpodd_poweroff_delay * 1000);
> + expires = zpodd->last_ready + secs_to_jiffies(zpodd_poweroff_delay);
> if (time_before(jiffies, expires))
> return;
>
>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 08/16] libata: zpodd: convert timeouts to secs_to_jiffies()
2025-01-29 0:21 ` Damien Le Moal
@ 2025-01-29 17:36 ` Easwar Hariharan
0 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-29 17:36 UTC (permalink / raw)
To: Damien Le Moal
Cc: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Niklas Cassel, Carlos Maiolino,
Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky, eahariha, cocci, linux-kernel,
linux-scsi, dri-devel, linux-sound, linux-btrfs, ceph-devel,
linux-block, linux-ide, linux-xfs, linux-pm, linux-nvme,
linux-spi, imx, linux-arm-kernel, platform-driver-x86,
ibm-acpi-devel, linux-rdma
On 1/28/2025 4:21 PM, Damien Le Moal wrote:
> On 1/29/25 3:21 AM, Easwar Hariharan 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:
>>
>> @depends on patch@
>> expression E;
>> @@
>>
>> -msecs_to_jiffies
>> +secs_to_jiffies
>> (E
>> - * \( 1000 \| MSEC_PER_SEC \)
>> )
>>
>> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
>
> The subject line should be:
>
> ata: libata-zpodd: convert timeouts to secs_to_jiffies()
>
> Other than that, looks good to me.
>
> Acked-by: Damien Le Moal <dlemoal@kernel.org>
>
Thanks for the review and ack! I'll fix the subject line in v2.
- Easwar (he/him)
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 09/16] xfs: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (7 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 08/16] libata: zpodd: " Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-28 19:32 ` Darrick J. Wong
` (2 more replies)
2025-01-28 18:21 ` [PATCH 10/16] power: supply: da9030: " Easwar Hariharan
` (7 subsequent siblings)
16 siblings, 3 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
fs/xfs/xfs_icache.c | 2 +-
fs/xfs/xfs_sysfs.c | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 7b6c026d01a1fc020a41a678964cdbf7a8113323..7a1feb8dc21f6f71d04f88de866e5a95925e0c54 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -230,7 +230,7 @@ xfs_blockgc_queue(
rcu_read_lock();
if (radix_tree_tagged(&pag->pag_ici_root, XFS_ICI_BLOCKGC_TAG))
queue_delayed_work(mp->m_blockgc_wq, &pag->pag_blockgc_work,
- msecs_to_jiffies(xfs_blockgc_secs * 1000));
+ secs_to_jiffies(xfs_blockgc_secs));
rcu_read_unlock();
}
diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
index 60cb5318fdae3cc246236fd988b4749df57f8bfc..eed0f28afe97ead762a9539e45f292db7d0d0c4a 100644
--- a/fs/xfs/xfs_sysfs.c
+++ b/fs/xfs/xfs_sysfs.c
@@ -568,8 +568,8 @@ retry_timeout_seconds_store(
if (val == -1)
cfg->retry_timeout = XFS_ERR_RETRY_FOREVER;
else {
- cfg->retry_timeout = msecs_to_jiffies(val * MSEC_PER_SEC);
- ASSERT(msecs_to_jiffies(val * MSEC_PER_SEC) < LONG_MAX);
+ cfg->retry_timeout = secs_to_jiffies(val);
+ ASSERT(secs_to_jiffies(val) < LONG_MAX);
}
return count;
}
@@ -686,8 +686,7 @@ xfs_error_sysfs_init_class(
if (init[i].retry_timeout == XFS_ERR_RETRY_FOREVER)
cfg->retry_timeout = XFS_ERR_RETRY_FOREVER;
else
- cfg->retry_timeout = msecs_to_jiffies(
- init[i].retry_timeout * MSEC_PER_SEC);
+ cfg->retry_timeout = secs_to_jiffies(init[i].retry_timeout);
}
return 0;
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 09/16] xfs: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 ` [PATCH 09/16] xfs: " Easwar Hariharan
@ 2025-01-28 19:32 ` Darrick J. Wong
2025-01-29 5:21 ` Christoph Hellwig
2025-01-29 6:27 ` Carlos Maiolino
2 siblings, 0 replies; 41+ messages in thread
From: Darrick J. Wong @ 2025-01-28 19:32 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky, cocci, linux-kernel, linux-scsi,
dri-devel, linux-sound, linux-btrfs, ceph-devel, linux-block,
linux-ide, linux-xfs, linux-pm, linux-nvme, linux-spi, imx,
linux-arm-kernel, platform-driver-x86, ibm-acpi-devel, linux-rdma
On Tue, Jan 28, 2025 at 06:21:54PM +0000, Easwar Hariharan 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:
>
> @depends on patch@
> expression E;
> @@
>
> -msecs_to_jiffies
> +secs_to_jiffies
> (E
> - * \( 1000 \| MSEC_PER_SEC \)
> )
>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Looks good to me,
Acked-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/xfs/xfs_icache.c | 2 +-
> fs/xfs/xfs_sysfs.c | 7 +++----
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 7b6c026d01a1fc020a41a678964cdbf7a8113323..7a1feb8dc21f6f71d04f88de866e5a95925e0c54 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -230,7 +230,7 @@ xfs_blockgc_queue(
> rcu_read_lock();
> if (radix_tree_tagged(&pag->pag_ici_root, XFS_ICI_BLOCKGC_TAG))
> queue_delayed_work(mp->m_blockgc_wq, &pag->pag_blockgc_work,
> - msecs_to_jiffies(xfs_blockgc_secs * 1000));
> + secs_to_jiffies(xfs_blockgc_secs));
> rcu_read_unlock();
> }
>
> diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
> index 60cb5318fdae3cc246236fd988b4749df57f8bfc..eed0f28afe97ead762a9539e45f292db7d0d0c4a 100644
> --- a/fs/xfs/xfs_sysfs.c
> +++ b/fs/xfs/xfs_sysfs.c
> @@ -568,8 +568,8 @@ retry_timeout_seconds_store(
> if (val == -1)
> cfg->retry_timeout = XFS_ERR_RETRY_FOREVER;
> else {
> - cfg->retry_timeout = msecs_to_jiffies(val * MSEC_PER_SEC);
> - ASSERT(msecs_to_jiffies(val * MSEC_PER_SEC) < LONG_MAX);
> + cfg->retry_timeout = secs_to_jiffies(val);
> + ASSERT(secs_to_jiffies(val) < LONG_MAX);
> }
> return count;
> }
> @@ -686,8 +686,7 @@ xfs_error_sysfs_init_class(
> if (init[i].retry_timeout == XFS_ERR_RETRY_FOREVER)
> cfg->retry_timeout = XFS_ERR_RETRY_FOREVER;
> else
> - cfg->retry_timeout = msecs_to_jiffies(
> - init[i].retry_timeout * MSEC_PER_SEC);
> + cfg->retry_timeout = secs_to_jiffies(init[i].retry_timeout);
> }
> return 0;
>
>
> --
> 2.43.0
>
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 09/16] xfs: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 ` [PATCH 09/16] xfs: " Easwar Hariharan
2025-01-28 19:32 ` Darrick J. Wong
@ 2025-01-29 5:21 ` Christoph Hellwig
2025-01-29 17:12 ` Easwar Hariharan
2025-01-29 6:27 ` Carlos Maiolino
2 siblings, 1 reply; 41+ messages in thread
From: Christoph Hellwig @ 2025-01-29 5:21 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky, cocci, linux-kernel, linux-scsi,
dri-devel, linux-sound, linux-btrfs, ceph-devel, linux-block,
linux-ide, linux-xfs, linux-pm, linux-nvme, linux-spi, imx,
linux-arm-kernel, platform-driver-x86, ibm-acpi-devel, linux-rdma
On Tue, Jan 28, 2025 at 06:21:54PM +0000, Easwar Hariharan wrote:
> else
> - cfg->retry_timeout = msecs_to_jiffies(
> - init[i].retry_timeout * MSEC_PER_SEC);
> + cfg->retry_timeout = secs_to_jiffies(init[i].retry_timeout);
This messes up the formatting by introducing an overly long line.
Otherwise the change looks fine.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 09/16] xfs: convert timeouts to secs_to_jiffies()
2025-01-29 5:21 ` Christoph Hellwig
@ 2025-01-29 17:12 ` Easwar Hariharan
2025-01-29 18:14 ` Easwar Hariharan
0 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-29 17:12 UTC (permalink / raw)
To: Christoph Hellwig
Cc: eahariha, Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Shyam Sundar S K,
Hans de Goede, Ilpo Järvinen, Henrique de Moraes Holschuh,
Selvin Xavier, Kalesh AP, Jason Gunthorpe, Leon Romanovsky, cocci,
linux-kernel, linux-scsi, dri-devel, linux-sound, linux-btrfs,
ceph-devel, linux-block, linux-ide, linux-xfs, linux-pm,
linux-nvme, linux-spi, imx, linux-arm-kernel, platform-driver-x86,
ibm-acpi-devel, linux-rdma
On 1/28/2025 9:21 PM, Christoph Hellwig wrote:
> On Tue, Jan 28, 2025 at 06:21:54PM +0000, Easwar Hariharan wrote:
>> else
>> - cfg->retry_timeout = msecs_to_jiffies(
>> - init[i].retry_timeout * MSEC_PER_SEC);
>> + cfg->retry_timeout = secs_to_jiffies(init[i].retry_timeout);
>
> This messes up the formatting by introducing an overly long line.
>
> Otherwise the change looks fine.
I'll fix this in v2. Thanks for the review!
- Easwar (he/him)
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 09/16] xfs: convert timeouts to secs_to_jiffies()
2025-01-29 17:12 ` Easwar Hariharan
@ 2025-01-29 18:14 ` Easwar Hariharan
0 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-29 18:14 UTC (permalink / raw)
To: Christoph Hellwig
Cc: eahariha, Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Shyam Sundar S K,
Hans de Goede, Ilpo Järvinen, Henrique de Moraes Holschuh,
Selvin Xavier, Kalesh AP, Jason Gunthorpe, Leon Romanovsky, cocci,
linux-kernel, linux-scsi, dri-devel, linux-sound, linux-btrfs,
ceph-devel, linux-block, linux-ide, linux-xfs, linux-pm,
linux-nvme, linux-spi, imx, linux-arm-kernel, platform-driver-x86,
ibm-acpi-devel, linux-rdma
On 1/29/2025 9:12 AM, Easwar Hariharan wrote:
> On 1/28/2025 9:21 PM, Christoph Hellwig wrote:
>> On Tue, Jan 28, 2025 at 06:21:54PM +0000, Easwar Hariharan wrote:
>>> else
>>> - cfg->retry_timeout = msecs_to_jiffies(
>>> - init[i].retry_timeout * MSEC_PER_SEC);
>>> + cfg->retry_timeout = secs_to_jiffies(init[i].retry_timeout);
>>
>> This messes up the formatting by introducing an overly long line.
>>
>> Otherwise the change looks fine.
>
> I'll fix this in v2. Thanks for the review!
>
> - Easwar (he/him)
Andrew seems to have fixed it up in his copy, so I'll skip this change
in v2. Thanks Andrew!
- Easwar
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 09/16] xfs: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 ` [PATCH 09/16] xfs: " Easwar Hariharan
2025-01-28 19:32 ` Darrick J. Wong
2025-01-29 5:21 ` Christoph Hellwig
@ 2025-01-29 6:27 ` Carlos Maiolino
2 siblings, 0 replies; 41+ messages in thread
From: Carlos Maiolino @ 2025-01-29 6:27 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky, cocci, linux-kernel, linux-scsi,
dri-devel, linux-sound, linux-btrfs, ceph-devel, linux-block,
linux-ide, linux-xfs, linux-pm, linux-nvme, linux-spi, imx,
linux-arm-kernel, platform-driver-x86, ibm-acpi-devel, linux-rdma
On Tue, Jan 28, 2025 at 06:21:54PM +0000, Easwar Hariharan 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:
>
> @depends on patch@
> expression E;
> @@
>
> -msecs_to_jiffies
> +secs_to_jiffies
> (E
> - * \( 1000 \| MSEC_PER_SEC \)
> )
>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> ---
> fs/xfs/xfs_icache.c | 2 +-
> fs/xfs/xfs_sysfs.c | 7 +++----
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 7b6c026d01a1fc020a41a678964cdbf7a8113323..7a1feb8dc21f6f71d04f88de866e5a95925e0c54 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -230,7 +230,7 @@ xfs_blockgc_queue(
> rcu_read_lock();
> if (radix_tree_tagged(&pag->pag_ici_root, XFS_ICI_BLOCKGC_TAG))
> queue_delayed_work(mp->m_blockgc_wq, &pag->pag_blockgc_work,
> - msecs_to_jiffies(xfs_blockgc_secs * 1000));
> + secs_to_jiffies(xfs_blockgc_secs));
> rcu_read_unlock();
> }
>
> diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
> index 60cb5318fdae3cc246236fd988b4749df57f8bfc..eed0f28afe97ead762a9539e45f292db7d0d0c4a 100644
> --- a/fs/xfs/xfs_sysfs.c
> +++ b/fs/xfs/xfs_sysfs.c
> @@ -568,8 +568,8 @@ retry_timeout_seconds_store(
> if (val == -1)
> cfg->retry_timeout = XFS_ERR_RETRY_FOREVER;
> else {
> - cfg->retry_timeout = msecs_to_jiffies(val * MSEC_PER_SEC);
> - ASSERT(msecs_to_jiffies(val * MSEC_PER_SEC) < LONG_MAX);
> + cfg->retry_timeout = secs_to_jiffies(val);
> + ASSERT(secs_to_jiffies(val) < LONG_MAX);
> }
> return count;
> }
> @@ -686,8 +686,7 @@ xfs_error_sysfs_init_class(
> if (init[i].retry_timeout == XFS_ERR_RETRY_FOREVER)
> cfg->retry_timeout = XFS_ERR_RETRY_FOREVER;
> else
> - cfg->retry_timeout = msecs_to_jiffies(
> - init[i].retry_timeout * MSEC_PER_SEC);
> + cfg->retry_timeout = secs_to_jiffies(init[i].retry_timeout);
> }
> return 0;
Looks fine to me.
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
>
>
> --
> 2.43.0
>
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 10/16] power: supply: da9030: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (8 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 09/16] xfs: " Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-28 18:21 ` [PATCH 11/16] nvme: " Easwar Hariharan
` (6 subsequent siblings)
16 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/power/supply/da9030_battery.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/power/supply/da9030_battery.c b/drivers/power/supply/da9030_battery.c
index ac2e319e95179039279dacaed1744136f679fbac..d25279c260308b6c82acb2aabf44f3749f71b703 100644
--- a/drivers/power/supply/da9030_battery.c
+++ b/drivers/power/supply/da9030_battery.c
@@ -502,8 +502,7 @@ static int da9030_battery_probe(struct platform_device *pdev)
/* 10 seconds between monitor runs unless platform defines other
interval */
- charger->interval = msecs_to_jiffies(
- (pdata->batmon_interval ? : 10) * 1000);
+ charger->interval = secs_to_jiffies(pdata->batmon_interval ? : 10);
charger->charge_milliamp = pdata->charge_milliamp;
charger->charge_millivolt = pdata->charge_millivolt;
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 11/16] nvme: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (9 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 10/16] power: supply: da9030: " Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-28 18:28 ` Keith Busch
2025-01-28 18:21 ` [PATCH 12/16] spi: spi-fsl-lpspi: " Easwar Hariharan
` (5 subsequent siblings)
16 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/nvme/host/core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 76b615d4d5b91e163e5a6e7baf451c959a2c3cab..87498215ede4bcaf48660b89c901075dfcfaf041 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4459,11 +4459,9 @@ static void nvme_fw_act_work(struct work_struct *work)
nvme_auth_stop(ctrl);
if (ctrl->mtfa)
- fw_act_timeout = jiffies +
- msecs_to_jiffies(ctrl->mtfa * 100);
+ fw_act_timeout = jiffies + msecs_to_jiffies(ctrl->mtfa * 100);
else
- fw_act_timeout = jiffies +
- msecs_to_jiffies(admin_timeout * 1000);
+ fw_act_timeout = jiffies + secs_to_jiffies(admin_timeout);
nvme_quiesce_io_queues(ctrl);
while (nvme_ctrl_pp_status(ctrl)) {
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 11/16] nvme: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 ` [PATCH 11/16] nvme: " Easwar Hariharan
@ 2025-01-28 18:28 ` Keith Busch
0 siblings, 0 replies; 41+ messages in thread
From: Keith Busch @ 2025-01-28 18:28 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky, cocci, linux-kernel, linux-scsi,
dri-devel, linux-sound, linux-btrfs, ceph-devel, linux-block,
linux-ide, linux-xfs, linux-pm, linux-nvme, linux-spi, imx,
linux-arm-kernel, platform-driver-x86, ibm-acpi-devel, linux-rdma
On Tue, Jan 28, 2025 at 06:21:56PM +0000, Easwar Hariharan 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:
>
> @depends on patch@
> expression E;
> @@
>
> -msecs_to_jiffies
> +secs_to_jiffies
> (E
> - * \( 1000 \| MSEC_PER_SEC \)
> )
>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> ---
> drivers/nvme/host/core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 76b615d4d5b91e163e5a6e7baf451c959a2c3cab..87498215ede4bcaf48660b89c901075dfcfaf041 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -4459,11 +4459,9 @@ static void nvme_fw_act_work(struct work_struct *work)
> nvme_auth_stop(ctrl);
>
> if (ctrl->mtfa)
> - fw_act_timeout = jiffies +
> - msecs_to_jiffies(ctrl->mtfa * 100);
> + fw_act_timeout = jiffies + msecs_to_jiffies(ctrl->mtfa * 100);
> else
> - fw_act_timeout = jiffies +
> - msecs_to_jiffies(admin_timeout * 1000);
> + fw_act_timeout = jiffies + secs_to_jiffies(admin_timeout);
>
> nvme_quiesce_io_queues(ctrl);
> while (nvme_ctrl_pp_status(ctrl)) {
>
> --
Acked-by: Keith Busch <kbusch@kernel.org>
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 12/16] spi: spi-fsl-lpspi: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (10 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 11/16] nvme: " Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-29 11:28 ` Mark Brown
2025-01-28 18:21 ` [PATCH 13/16] spi: spi-imx: " Easwar Hariharan
` (4 subsequent siblings)
16 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/spi/spi-fsl-lpspi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index 40f5c8fdba765a1334710a696966232a459316e6..5e381844523440c03b1d0bbe4a044f28fbfbc738 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -572,7 +572,7 @@ static int fsl_lpspi_calculate_timeout(struct fsl_lpspi_data *fsl_lpspi,
timeout += 1;
/* Double calculated timeout */
- return msecs_to_jiffies(2 * timeout * MSEC_PER_SEC);
+ return secs_to_jiffies(2 * timeout);
}
static int fsl_lpspi_dma_transfer(struct spi_controller *controller,
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 12/16] spi: spi-fsl-lpspi: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 ` [PATCH 12/16] spi: spi-fsl-lpspi: " Easwar Hariharan
@ 2025-01-29 11:28 ` Mark Brown
0 siblings, 0 replies; 41+ messages in thread
From: Mark Brown @ 2025-01-29 11:28 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky, cocci, linux-kernel, linux-scsi,
dri-devel, linux-sound, linux-btrfs, ceph-devel, linux-block,
linux-ide, linux-xfs, linux-pm, linux-nvme, linux-spi, imx,
linux-arm-kernel, platform-driver-x86, ibm-acpi-devel, linux-rdma
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
On Tue, Jan 28, 2025 at 06:21:57PM +0000, Easwar Hariharan 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.
Acked-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 13/16] spi: spi-imx: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (11 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 12/16] spi: spi-fsl-lpspi: " Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-29 11:30 ` Mark Brown
2025-01-28 18:21 ` [PATCH 14/16] platform/x86/amd/pmf: " Easwar Hariharan
` (3 subsequent siblings)
16 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/spi/spi-imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index eeb7d082c2472f954001045295b349bc2eb53197..832d6e9009ebe741779acd58c3a9450c231151bb 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -1449,7 +1449,7 @@ static int spi_imx_calculate_timeout(struct spi_imx_data *spi_imx, int size)
timeout += 1;
/* Double calculated timeout */
- return msecs_to_jiffies(2 * timeout * MSEC_PER_SEC);
+ return secs_to_jiffies(2 * timeout);
}
static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 13/16] spi: spi-imx: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 ` [PATCH 13/16] spi: spi-imx: " Easwar Hariharan
@ 2025-01-29 11:30 ` Mark Brown
0 siblings, 0 replies; 41+ messages in thread
From: Mark Brown @ 2025-01-29 11:30 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky, cocci, linux-kernel, linux-scsi,
dri-devel, linux-sound, linux-btrfs, ceph-devel, linux-block,
linux-ide, linux-xfs, linux-pm, linux-nvme, linux-spi, imx,
linux-arm-kernel, platform-driver-x86, ibm-acpi-devel, linux-rdma
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
On Tue, Jan 28, 2025 at 06:21:58PM +0000, Easwar Hariharan 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.
Acked-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 14/16] platform/x86/amd/pmf: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (12 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 13/16] spi: spi-imx: " Easwar Hariharan
@ 2025-01-28 18:21 ` Easwar Hariharan
2025-01-29 13:12 ` Ilpo Järvinen
2025-01-28 18:22 ` [PATCH 15/16] platform/x86: thinkpad_acpi: " Easwar Hariharan
` (2 subsequent siblings)
16 siblings, 1 reply; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:21 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/platform/x86/amd/pmf/acpi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/amd/pmf/acpi.c
index dd5780a1d06e1dc979fcff5bafd6729bc4937eab..6b7effe80b78b7389b320ee65fa5d2373f782a2f 100644
--- a/drivers/platform/x86/amd/pmf/acpi.c
+++ b/drivers/platform/x86/amd/pmf/acpi.c
@@ -220,7 +220,8 @@ static void apmf_sbios_heartbeat_notify(struct work_struct *work)
if (!info)
return;
- schedule_delayed_work(&dev->heart_beat, msecs_to_jiffies(dev->hb_interval * 1000));
+ schedule_delayed_work(&dev->heart_beat,
+ secs_to_jiffies(dev->hb_interval));
kfree(info);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 14/16] platform/x86/amd/pmf: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 ` [PATCH 14/16] platform/x86/amd/pmf: " Easwar Hariharan
@ 2025-01-29 13:12 ` Ilpo Järvinen
2025-01-29 17:12 ` Easwar Hariharan
0 siblings, 1 reply; 41+ messages in thread
From: Ilpo Järvinen @ 2025-01-29 13:12 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Henrique de Moraes Holschuh,
Selvin Xavier, Kalesh AP, Jason Gunthorpe, Leon Romanovsky, cocci,
LKML, linux-scsi, dri-devel, linux-sound, linux-btrfs, ceph-devel,
linux-block, linux-ide, linux-xfs, linux-pm, linux-nvme,
linux-spi, imx, linux-arm-kernel, platform-driver-x86,
ibm-acpi-devel, linux-rdma
On Tue, 28 Jan 2025, Easwar Hariharan 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:
>
> @depends on patch@
> expression E;
> @@
>
> -msecs_to_jiffies
> +secs_to_jiffies
> (E
> - * \( 1000 \| MSEC_PER_SEC \)
> )
>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> ---
> drivers/platform/x86/amd/pmf/acpi.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/amd/pmf/acpi.c
> index dd5780a1d06e1dc979fcff5bafd6729bc4937eab..6b7effe80b78b7389b320ee65fa5d2373f782a2f 100644
> --- a/drivers/platform/x86/amd/pmf/acpi.c
> +++ b/drivers/platform/x86/amd/pmf/acpi.c
> @@ -220,7 +220,8 @@ static void apmf_sbios_heartbeat_notify(struct work_struct *work)
> if (!info)
> return;
>
> - schedule_delayed_work(&dev->heart_beat, msecs_to_jiffies(dev->hb_interval * 1000));
> + schedule_delayed_work(&dev->heart_beat,
> + secs_to_jiffies(dev->hb_interval));
> kfree(info);
> }
Hi,
So you made the line shorter but still added the newline char for some
reason even if the original didn't have one?? Please don't enforce 80
chars limit with patches like this.
--
i.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 14/16] platform/x86/amd/pmf: convert timeouts to secs_to_jiffies()
2025-01-29 13:12 ` Ilpo Järvinen
@ 2025-01-29 17:12 ` Easwar Hariharan
0 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-29 17:12 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: eahariha, Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Henrique de Moraes Holschuh,
Selvin Xavier, Kalesh AP, Jason Gunthorpe, Leon Romanovsky, cocci,
LKML, linux-scsi, dri-devel, linux-sound, linux-btrfs, ceph-devel,
linux-block, linux-ide, linux-xfs, linux-pm, linux-nvme,
linux-spi, imx, linux-arm-kernel, platform-driver-x86,
ibm-acpi-devel, linux-rdma
On 1/29/2025 5:12 AM, Ilpo Järvinen wrote:
> On Tue, 28 Jan 2025, Easwar Hariharan 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:
>>
>> @depends on patch@
>> expression E;
>> @@
>>
>> -msecs_to_jiffies
>> +secs_to_jiffies
>> (E
>> - * \( 1000 \| MSEC_PER_SEC \)
>> )
>>
>> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
>> ---
>> drivers/platform/x86/amd/pmf/acpi.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/amd/pmf/acpi.c
>> index dd5780a1d06e1dc979fcff5bafd6729bc4937eab..6b7effe80b78b7389b320ee65fa5d2373f782a2f 100644
>> --- a/drivers/platform/x86/amd/pmf/acpi.c
>> +++ b/drivers/platform/x86/amd/pmf/acpi.c
>> @@ -220,7 +220,8 @@ static void apmf_sbios_heartbeat_notify(struct work_struct *work)
>> if (!info)
>> return;
>>
>> - schedule_delayed_work(&dev->heart_beat, msecs_to_jiffies(dev->hb_interval * 1000));
>> + schedule_delayed_work(&dev->heart_beat,
>> + secs_to_jiffies(dev->hb_interval));
>> kfree(info);
>> }
>
> Hi,
>
> So you made the line shorter but still added the newline char for some
> reason even if the original didn't have one?? Please don't enforce 80
> chars limit with patches like this.
>
Sorry about that, I can fix that in v2.
Thanks for the review!
- Easwar (he/him)
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH 15/16] platform/x86: thinkpad_acpi: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (13 preceding siblings ...)
2025-01-28 18:21 ` [PATCH 14/16] platform/x86/amd/pmf: " Easwar Hariharan
@ 2025-01-28 18:22 ` Easwar Hariharan
2025-01-28 18:22 ` [PATCH 16/16] RDMA/bnxt_re: " Easwar Hariharan
2025-01-29 0:16 ` [PATCH 00/16] Converge on using secs_to_jiffies() part two Andrew Morton
16 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:22 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/platform/x86/thinkpad_acpi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 1fcb0f99695a78d392ed000b0831eb4d45eff55f..500b497c3f375f463f014ed3f3361afc9d6f3329 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -8505,7 +8505,7 @@ static void fan_watchdog_reset(void)
if (fan_watchdog_maxinterval > 0 &&
tpacpi_lifecycle != TPACPI_LIFE_EXITING)
mod_delayed_work(tpacpi_wq, &fan_watchdog_task,
- msecs_to_jiffies(fan_watchdog_maxinterval * 1000));
+ secs_to_jiffies(fan_watchdog_maxinterval));
else
cancel_delayed_work(&fan_watchdog_task);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH 16/16] RDMA/bnxt_re: convert timeouts to secs_to_jiffies()
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (14 preceding siblings ...)
2025-01-28 18:22 ` [PATCH 15/16] platform/x86: thinkpad_acpi: " Easwar Hariharan
@ 2025-01-28 18:22 ` Easwar Hariharan
2025-01-29 0:16 ` [PATCH 00/16] Converge on using secs_to_jiffies() part two Andrew Morton
16 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-01-28 18:22 UTC (permalink / raw)
To: Andrew Morton, Yaron Avizrat, Oded Gabbay, Julia Lawall,
Nicolas Palix, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky
Cc: cocci, linux-kernel, linux-scsi, dri-devel, linux-sound,
linux-btrfs, ceph-devel, linux-block, linux-ide, linux-xfs,
linux-pm, linux-nvme, linux-spi, imx, linux-arm-kernel,
platform-driver-x86, ibm-acpi-devel, linux-rdma, 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:
@depends on patch@
expression E;
@@
-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
index 17e62f22683b14a3571188e25fe0df3cbf1d8360..b1a18c9cb7f6c248548bc38fcb98781a3030a1b6 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
@@ -160,7 +160,7 @@ static int __wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie)
wait_event_timeout(cmdq->waitq,
!crsqe->is_in_used ||
test_bit(ERR_DEVICE_DETACHED, &cmdq->flags),
- msecs_to_jiffies(rcfw->max_timeout * 1000));
+ secs_to_jiffies(rcfw->max_timeout));
if (!crsqe->is_in_used)
return 0;
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH 00/16] Converge on using secs_to_jiffies() part two
2025-01-28 18:21 [PATCH 00/16] Converge on using secs_to_jiffies() part two Easwar Hariharan
` (15 preceding siblings ...)
2025-01-28 18:22 ` [PATCH 16/16] RDMA/bnxt_re: " Easwar Hariharan
@ 2025-01-29 0:16 ` Andrew Morton
2025-02-13 17:45 ` Easwar Hariharan
16 siblings, 1 reply; 41+ messages in thread
From: Andrew Morton @ 2025-01-29 0:16 UTC (permalink / raw)
To: Easwar Hariharan
Cc: Yaron Avizrat, Oded Gabbay, Julia Lawall, Nicolas Palix,
James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky, cocci, linux-kernel, linux-scsi,
dri-devel, linux-sound, linux-btrfs, ceph-devel, linux-block,
linux-ide, linux-xfs, linux-pm, linux-nvme, linux-spi, imx,
linux-arm-kernel, platform-driver-x86, ibm-acpi-devel, linux-rdma
On Tue, 28 Jan 2025 18:21:45 +0000 Easwar Hariharan <eahariha@linux.microsoft.com> wrote:
> This is the second series (part 1*) that converts users of msecs_to_jiffies() that
> either 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 or an expression, to avoid the multiplication.
>
> The conversion is made with Coccinelle with the secs_to_jiffies() script
> in scripts/coccinelle/misc. Attention is paid to what the best change
> can be rather than restricting to what the tool provides.
>
> Andrew has kindly agreed to take the series through mm.git modulo the
> patches maintainers want to pick through their own trees.
I added patches 2-16 to mm.git. If any of these later get merged into
a subsystem tree, Stephen will tell us and I'll drop the mm.git copy.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH 00/16] Converge on using secs_to_jiffies() part two
2025-01-29 0:16 ` [PATCH 00/16] Converge on using secs_to_jiffies() part two Andrew Morton
@ 2025-02-13 17:45 ` Easwar Hariharan
0 siblings, 0 replies; 41+ messages in thread
From: Easwar Hariharan @ 2025-02-13 17:45 UTC (permalink / raw)
To: Andrew Morton
Cc: eahariha, Yaron Avizrat, Oded Gabbay, Julia Lawall, Nicolas Palix,
James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Jaroslav Kysela, Takashi Iwai, Chris Mason,
Josef Bacik, David Sterba, Ilya Dryomov, Dongsheng Yang,
Jens Axboe, Xiubo Li, Damien Le Moal, Niklas Cassel,
Carlos Maiolino, Darrick J. Wong, Sebastian Reichel, Keith Busch,
Christoph Hellwig, Sagi Grimberg, Frank Li, Mark Brown, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
Henrique de Moraes Holschuh, Selvin Xavier, Kalesh AP,
Jason Gunthorpe, Leon Romanovsky, cocci, linux-kernel, linux-scsi,
dri-devel, linux-sound, linux-btrfs, ceph-devel, linux-block,
linux-ide, linux-xfs, linux-pm, linux-nvme, linux-spi, imx,
linux-arm-kernel, platform-driver-x86, ibm-acpi-devel, linux-rdma,
Thomas Gleixner
On 1/28/2025 4:16 PM, Andrew Morton wrote:
> On Tue, 28 Jan 2025 18:21:45 +0000 Easwar Hariharan <eahariha@linux.microsoft.com> wrote:
>
>> This is the second series (part 1*) that converts users of msecs_to_jiffies() that
>> either 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 or an expression, to avoid the multiplication.
>>
>> The conversion is made with Coccinelle with the secs_to_jiffies() script
>> in scripts/coccinelle/misc. Attention is paid to what the best change
>> can be rather than restricting to what the tool provides.
>>
>> Andrew has kindly agreed to take the series through mm.git modulo the
>> patches maintainers want to pick through their own trees.
>
> I added patches 2-16 to mm.git. If any of these later get merged into
> a subsystem tree, Stephen will tell us and I'll drop the mm.git copy.
Hi Andrew, I don't see these in mm-nonmm-unstable. Did these get dropped in the confusion around
casting secs_to_jiffies() to unsigned long[1]? That has since been merged in 6.14-rc2 via tglx' tree,
and I have a v2 for just the ceph patches that needed some fixups at [2].
[1] https://lore.kernel.org/all/20250130192701.99626-1-eahariha@linux.microsoft.com/
[2] https://lore.kernel.org/all/20250203-converge-secs-to-jiffies-part-two-v2-0-d7058a01fd0e@linux.microsoft.com/
Thanks,
Easwar (he/him)
^ permalink raw reply [flat|nested] 41+ messages in thread