mbox series

[v2,00/21] Converge on using secs_to_jiffies()

Message ID 20241115-converge-secs-to-jiffies-v2-0-911fb7595e79@linux.microsoft.com
Headers show
Series Converge on using secs_to_jiffies() | expand

Message

Easwar Hariharan Nov. 15, 2024, 9:26 p.m. UTC
This is a series that follows up on my previous series to introduce
secs_to_jiffies() and convert a few initial users.[1] In the review for
that series, Anna-Maria requested converting other users with
Coccinelle. This is part 1 that converts users of msecs_to_jiffies()
that use the multiply pattern of either of:
- msecs_to_jiffies(N*1000), or
- msecs_to_jiffies(N*MSEC_PER_SEC)

The entire conversion is made with Coccinelle in the script added in
patch 2. Some changes suggested by Coccinelle have been deferred to
later parts that will address other possible variant patterns.

CC: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>

[1] https://lore.kernel.org/all/20241030-open-coded-timeouts-v3-0-9ba123facf88@linux.microsoft.com/
[2] https://lore.kernel.org/all/8734kngfni.fsf@somnus/

---
Changes in v2:
- EDITME: describe what is new in this series revision.
- EDITME: use bulletpoints and terse descriptions.
- Link to v1: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v1-0-19aadc34941b@linux.microsoft.com

---
Easwar Hariharan (21):
      netfilter: conntrack: Cleanup timeout definitions
      coccinelle: misc: Add secs_to_jiffies script
      arm: pxa: Convert timeouts to use secs_to_jiffies()
      s390: kernel: Convert timeouts to use secs_to_jiffies()
      powerpc/papr_scm: Convert timeouts to secs_to_jiffies()
      mm: kmemleak: Convert timeouts to secs_to_jiffies()
      accel/habanalabs: Convert timeouts to secs_to_jiffies()
      drm/xe: Convert timeout to secs_to_jiffies()
      drm/etnaviv: Convert timeouts to secs_to_jiffies()
      scsi: lpfc: Convert timeouts to secs_to_jiffies()
      scsi: arcmsr: Convert timeouts to secs_to_jiffies()
      scsi: pm8001: Convert timeouts to secs_to_jiffies()
      xen/blkback: Convert timeouts to secs_to_jiffies()
      gve: Convert timeouts to secs_to_jiffies()
      wifi: ath11k: Convert timeouts to secs_to_jiffies()
      Bluetooth: MGMT: Convert timeouts to secs_to_jiffies()
      staging: vc04_services: Convert timeouts to secs_to_jiffies()
      ceph: Convert timeouts to secs_to_jiffies()
      livepatch: Convert timeouts to secs_to_jiffies()
      ALSA: line6: Convert timeouts to secs_to_jiffies()
      nfp: Convert timeouts to secs_to_jiffies()

 arch/arm/mach-pxa/sharpsl_pm.c                      |  6 +++---
 arch/powerpc/platforms/pseries/papr_scm.c           |  2 +-
 arch/s390/kernel/lgr.c                              |  3 ++-
 arch/s390/kernel/time.c                             |  4 ++--
 arch/s390/kernel/topology.c                         |  2 +-
 drivers/accel/habanalabs/common/device.c            |  2 +-
 drivers/accel/habanalabs/common/habanalabs_drv.c    |  3 +--
 drivers/block/xen-blkback/blkback.c                 |  2 +-
 drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c            |  2 +-
 drivers/gpu/drm/xe/xe_device.c                      |  2 +-
 drivers/net/ethernet/google/gve/gve_tx_dqo.c        |  6 ++----
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c |  2 +-
 drivers/net/wireless/ath/ath11k/debugfs.c           |  2 +-
 drivers/scsi/arcmsr/arcmsr_hba.c                    |  2 +-
 drivers/scsi/lpfc/lpfc_init.c                       | 18 +++++++++---------
 drivers/scsi/lpfc/lpfc_nportdisc.c                  |  8 ++++----
 drivers/scsi/lpfc/lpfc_nvme.c                       |  2 +-
 drivers/scsi/lpfc/lpfc_sli.c                        |  4 ++--
 drivers/scsi/lpfc/lpfc_vmid.c                       |  2 +-
 drivers/scsi/pm8001/pm8001_init.c                   |  2 +-
 .../vc04_services/bcm2835-audio/bcm2835-vchiq.c     |  2 +-
 fs/ceph/quota.c                                     |  2 +-
 mm/kmemleak.c                                       |  4 ++--
 net/bluetooth/mgmt.c                                |  2 +-
 net/netfilter/nf_conntrack_proto_sctp.c             | 21 ++++++++-------------
 samples/livepatch/livepatch-callbacks-busymod.c     |  2 +-
 samples/livepatch/livepatch-shadow-fix1.c           |  2 +-
 samples/livepatch/livepatch-shadow-mod.c            | 10 +++++-----
 scripts/coccinelle/misc/secs_to_jiffies.cocci       | 21 +++++++++++++++++++++
 sound/usb/line6/toneport.c                          |  2 +-
 30 files changed, 79 insertions(+), 65 deletions(-)
---
base-commit: 2d5404caa8c7bb5c4e0435f94b28834ae5456623
change-id: 20241112-converge-secs-to-jiffies-d99d1016bd11

Best regards,

Comments

Easwar Hariharan Nov. 15, 2024, 9:29 p.m. UTC | #1
On 11/15/2024 1:26 PM, Easwar Hariharan wrote:
> This is a series that follows up on my previous series to introduce
> secs_to_jiffies() and convert a few initial users.[1] In the review for
> that series, Anna-Maria requested converting other users with
> Coccinelle. This is part 1 that converts users of msecs_to_jiffies()
> that use the multiply pattern of either of:
> - msecs_to_jiffies(N*1000), or
> - msecs_to_jiffies(N*MSEC_PER_SEC)
> 
> The entire conversion is made with Coccinelle in the script added in
> patch 2. Some changes suggested by Coccinelle have been deferred to
> later parts that will address other possible variant patterns.
> 
> CC: Anna-Maria Behnsen <anna-maria@linutronix.de>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> 
> [1] https://lore.kernel.org/all/20241030-open-coded-timeouts-v3-0-9ba123facf88@linux.microsoft.com/
> [2] https://lore.kernel.org/all/8734kngfni.fsf@somnus/
> 
> ---
> Changes in v2:
> - EDITME: describe what is new in this series revision.
> - EDITME: use bulletpoints and terse descriptions.
> - Link to v1: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v1-0-19aadc34941b@linux.microsoft.com
>

Apologies, I missed out on editing the changelog here. v1 included a
patch that's already been accepted, there are no other changes in v2.

Thanks,
Easwar
Jeff Johnson Nov. 15, 2024, 9:41 p.m. UTC | #2
On 11/15/2024 1:29 PM, Easwar Hariharan wrote:
> On 11/15/2024 1:26 PM, Easwar Hariharan wrote:
>> This is a series that follows up on my previous series to introduce
>> secs_to_jiffies() and convert a few initial users.[1] In the review for
>> that series, Anna-Maria requested converting other users with
>> Coccinelle. This is part 1 that converts users of msecs_to_jiffies()
>> that use the multiply pattern of either of:
>> - msecs_to_jiffies(N*1000), or
>> - msecs_to_jiffies(N*MSEC_PER_SEC)
>>
>> The entire conversion is made with Coccinelle in the script added in
>> patch 2. Some changes suggested by Coccinelle have been deferred to
>> later parts that will address other possible variant patterns.
>>
>> CC: Anna-Maria Behnsen <anna-maria@linutronix.de>
>> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
>>
>> [1] https://lore.kernel.org/all/20241030-open-coded-timeouts-v3-0-9ba123facf88@linux.microsoft.com/
>> [2] https://lore.kernel.org/all/8734kngfni.fsf@somnus/
>>
>> ---
>> Changes in v2:
>> - EDITME: describe what is new in this series revision.
>> - EDITME: use bulletpoints and terse descriptions.
>> - Link to v1: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v1-0-19aadc34941b@linux.microsoft.com
>>
> 
> Apologies, I missed out on editing the changelog here. v1 included a
> patch that's already been accepted, there are no other changes in v2.
> 
> Thanks,
> Easwar

How do you expect this series to land since it overlaps a large number of
maintainer trees? Do you have a maintainer who has volunteered to take the
series and the maintainers should just ack? Or do you want the maintainers to
take the individual patches that are applicable to them?

/jeff
Easwar Hariharan Nov. 15, 2024, 10:15 p.m. UTC | #3
On 11/15/2024 1:41 PM, Jeff Johnson wrote:
> On 11/15/2024 1:29 PM, Easwar Hariharan wrote:
>> On 11/15/2024 1:26 PM, Easwar Hariharan wrote:
>>> This is a series that follows up on my previous series to introduce
>>> secs_to_jiffies() and convert a few initial users.[1] In the review for
>>> that series, Anna-Maria requested converting other users with
>>> Coccinelle. This is part 1 that converts users of msecs_to_jiffies()
>>> that use the multiply pattern of either of:
>>> - msecs_to_jiffies(N*1000), or
>>> - msecs_to_jiffies(N*MSEC_PER_SEC)
>>>
>>> The entire conversion is made with Coccinelle in the script added in
>>> patch 2. Some changes suggested by Coccinelle have been deferred to
>>> later parts that will address other possible variant patterns.
>>>
>>> CC: Anna-Maria Behnsen <anna-maria@linutronix.de>
>>> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
>>>
>>> [1] https://lore.kernel.org/all/20241030-open-coded-timeouts-v3-0-9ba123facf88@linux.microsoft.com/
>>> [2] https://lore.kernel.org/all/8734kngfni.fsf@somnus/
>>>
>>> ---
>>> Changes in v2:
>>> - EDITME: describe what is new in this series revision.
>>> - EDITME: use bulletpoints and terse descriptions.
>>> - Link to v1: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v1-0-19aadc34941b@linux.microsoft.com
>>>
>>
>> Apologies, I missed out on editing the changelog here. v1 included a
>> patch that's already been accepted, there are no other changes in v2.
>>
>> Thanks,
>> Easwar
> 
> How do you expect this series to land since it overlaps a large number of
> maintainer trees? Do you have a maintainer who has volunteered to take the
> series and the maintainers should just ack? Or do you want the maintainers to
> take the individual patches that are applicable to them?
> 
> /jeff

I am hoping for tglx to take it through his tree since the patch
introducing secs_to_jiffies() is in his tree, so sequencing of
dependencies would not be an issue.

But if tglx won't, we could push it out another cycle and individual
maintainers can take the patches that are applicable to their tree for
the series.

Thanks,
Easwar
Stephen Rothwell Nov. 15, 2024, 10:34 p.m. UTC | #4
Hi Easwar,

On Fri, 15 Nov 2024 21:26:18 +0000 Easwar Hariharan <eahariha@linux.microsoft.com> wrote:
>
>  static const unsigned int sctp_timeouts[SCTP_CONNTRACK_MAX] = {
> -	[SCTP_CONNTRACK_CLOSED]			= 10 SECS,
> -	[SCTP_CONNTRACK_COOKIE_WAIT]		= 3 SECS,
> -	[SCTP_CONNTRACK_COOKIE_ECHOED]		= 3 SECS,
> -	[SCTP_CONNTRACK_ESTABLISHED]		= 210 SECS,
> -	[SCTP_CONNTRACK_SHUTDOWN_SENT]		= 3 SECS,
> -	[SCTP_CONNTRACK_SHUTDOWN_RECD]		= 3 SECS,
> -	[SCTP_CONNTRACK_SHUTDOWN_ACK_SENT]	= 3 SECS,
> -	[SCTP_CONNTRACK_HEARTBEAT_SENT]		= 30 SECS,
> +	[SCTP_CONNTRACK_CLOSED]			= secs_to_jiffies(10),
> +	[SCTP_CONNTRACK_COOKIE_WAIT]		= secs_to_jiffies(3),
> +	[SCTP_CONNTRACK_COOKIE_ECHOED]		= secs_to_jiffies(3),
> +	[SCTP_CONNTRACK_ESTABLISHED]		= secs_to_jiffies(210),
> +	[SCTP_CONNTRACK_SHUTDOWN_SENT]		= secs_to_jiffies(3),
> +	[SCTP_CONNTRACK_SHUTDOWN_RECD]		= secs_to_jiffies(3),
> +	[SCTP_CONNTRACK_SHUTDOWN_ACK_SENT]	= secs_to_jiffies(3),
> +	[SCTP_CONNTRACK_HEARTBEAT_SENT]		= secs_to_jiffies(3),

You have changed this last timeout from 30 seconds to 3 (presumably
just a copy and paste error).
Jeff Johnson Nov. 15, 2024, 10:59 p.m. UTC | #5
On 11/15/2024 1:26 PM, Easwar Hariharan wrote:
> Changes made with the following Coccinelle rules:
> 
> @@ constant C; @@
> 
> - msecs_to_jiffies(C * 1000)
> + secs_to_jiffies(C)
> 
> @@ constant C; @@
> 
> - msecs_to_jiffies(C * MSEC_PER_SEC)
> + secs_to_jiffies(C)
> 
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>

Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>

> ---
>  drivers/net/wireless/ath/ath11k/debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/debugfs.c b/drivers/net/wireless/ath/ath11k/debugfs.c
> index 57281a135dd7fa6b8610636f47873c8bba21053c..bf192529e3fe26a91e72105a77b4c6f849b905ec 100644
> --- a/drivers/net/wireless/ath/ath11k/debugfs.c
> +++ b/drivers/net/wireless/ath/ath11k/debugfs.c
> @@ -178,7 +178,7 @@ static int ath11k_debugfs_fw_stats_request(struct ath11k *ar,
>  	 * received 'update stats' event, we keep a 3 seconds timeout in case,
>  	 * fw_stats_done is not marked yet
>  	 */
> -	timeout = jiffies + msecs_to_jiffies(3 * 1000);
> +	timeout = jiffies + secs_to_jiffies(3);
>  
>  	ath11k_debugfs_fw_stats_reset(ar);
>  
>
Thomas Gleixner Nov. 15, 2024, 11:20 p.m. UTC | #6
On Fri, Nov 15 2024 at 14:15, Easwar Hariharan wrote:
> On 11/15/2024 1:41 PM, Jeff Johnson wrote:
>> 
>> How do you expect this series to land since it overlaps a large number of
>> maintainer trees? Do you have a maintainer who has volunteered to take the
>> series and the maintainers should just ack? Or do you want the maintainers to
>> take the individual patches that are applicable to them?
>> 
>> /jeff
>
> I am hoping for tglx to take it through his tree since the patch
> introducing secs_to_jiffies() is in his tree, so sequencing of
> dependencies would not be an issue.

Right, but it's two days before the merge window opens, so no.

> But if tglx won't, we could push it out another cycle and individual
> maintainers can take the patches that are applicable to their tree for
> the series.

That's the easiest way forward as it does not create conflicts and all
maintainers will have the base patch in their trees after rc1.

Thanks,

        tglx
Easwar Hariharan Nov. 16, 2024, 12:13 a.m. UTC | #7
On 11/15/2024 2:34 PM, Stephen Rothwell wrote:
> Hi Easwar,
> 
> On Fri, 15 Nov 2024 21:26:18 +0000 Easwar Hariharan <eahariha@linux.microsoft.com> wrote:
>>
>>  static const unsigned int sctp_timeouts[SCTP_CONNTRACK_MAX] = {
>> -	[SCTP_CONNTRACK_CLOSED]			= 10 SECS,
>> -	[SCTP_CONNTRACK_COOKIE_WAIT]		= 3 SECS,
>> -	[SCTP_CONNTRACK_COOKIE_ECHOED]		= 3 SECS,
>> -	[SCTP_CONNTRACK_ESTABLISHED]		= 210 SECS,
>> -	[SCTP_CONNTRACK_SHUTDOWN_SENT]		= 3 SECS,
>> -	[SCTP_CONNTRACK_SHUTDOWN_RECD]		= 3 SECS,
>> -	[SCTP_CONNTRACK_SHUTDOWN_ACK_SENT]	= 3 SECS,
>> -	[SCTP_CONNTRACK_HEARTBEAT_SENT]		= 30 SECS,
>> +	[SCTP_CONNTRACK_CLOSED]			= secs_to_jiffies(10),
>> +	[SCTP_CONNTRACK_COOKIE_WAIT]		= secs_to_jiffies(3),
>> +	[SCTP_CONNTRACK_COOKIE_ECHOED]		= secs_to_jiffies(3),
>> +	[SCTP_CONNTRACK_ESTABLISHED]		= secs_to_jiffies(210),
>> +	[SCTP_CONNTRACK_SHUTDOWN_SENT]		= secs_to_jiffies(3),
>> +	[SCTP_CONNTRACK_SHUTDOWN_RECD]		= secs_to_jiffies(3),
>> +	[SCTP_CONNTRACK_SHUTDOWN_ACK_SENT]	= secs_to_jiffies(3),
>> +	[SCTP_CONNTRACK_HEARTBEAT_SENT]		= secs_to_jiffies(3),
> 
> You have changed this last timeout from 30 seconds to 3 (presumably
> just a copy and paste error).
> 

Will fix in v3.
Christophe Leroy Nov. 16, 2024, 7:46 a.m. UTC | #8
Le 15/11/2024 à 22:29, Easwar Hariharan a écrit :
> [Vous ne recevez pas souvent de courriers de eahariha@linux.microsoft.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> On 11/15/2024 1:26 PM, Easwar Hariharan wrote:
>> This is a series that follows up on my previous series to introduce
>> secs_to_jiffies() and convert a few initial users.[1] In the review for
>> that series, Anna-Maria requested converting other users with
>> Coccinelle. This is part 1 that converts users of msecs_to_jiffies()
>> that use the multiply pattern of either of:
>> - msecs_to_jiffies(N*1000), or
>> - msecs_to_jiffies(N*MSEC_PER_SEC)
>>
>> The entire conversion is made with Coccinelle in the script added in
>> patch 2. Some changes suggested by Coccinelle have been deferred to
>> later parts that will address other possible variant patterns.
>>
>> CC: Anna-Maria Behnsen <anna-maria@linutronix.de>
>> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
>>
>> [1] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fall%2F20241030-open-coded-timeouts-v3-0-9ba123facf88%40linux.microsoft.com%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7Cff4857ad28a74e7051f708dd05bc8d45%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638673029556700628%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=q%2FHm%2Fal%2FBtK5J4nd%2BqJHNeSJ3f%2B0lVCKzigUUoL2vjw%3D&reserved=0
>> [2] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fall%2F8734kngfni.fsf%40somnus%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7Cff4857ad28a74e7051f708dd05bc8d45%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638673029556721028%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=PZiR%2B9GSo3Zk7cD85MyM4ZpqvIQtD0lSxd4G1gZ4UFE%3D&reserved=0
>>
>> ---
>> Changes in v2:
>> - EDITME: describe what is new in this series revision.
>> - EDITME: use bulletpoints and terse descriptions.
>> - Link to v1: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fr%2F20241115-converge-secs-to-jiffies-v1-0-19aadc34941b%40linux.microsoft.com&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7Cff4857ad28a74e7051f708dd05bc8d45%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638673029556732854%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=NXdY%2FTuSufEPcy4ijIj%2F0%2BW3K%2FhkLs2JGu5C1WFMPOM%3D&reserved=0
>>
> 
> Apologies, I missed out on editing the changelog here. v1 included a
> patch that's already been accepted, there are no other changes in v2.

You should refrain from sending such a patch bomb twice in 4 minutes. If 
there is no other change you could have just replied to that already 
included patch to say so.

In any case wait a few days so that people have time to review and 
provide comments.

Christophe
Christophe Leroy Nov. 16, 2024, 9:40 a.m. UTC | #9
Le 15/11/2024 à 22:26, Easwar Hariharan a écrit :
> [Vous ne recevez pas souvent de courriers de eahariha@linux.microsoft.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> None of the higher order definitions are used anymore, so remove
> definitions for minutes, hours, and days timeouts. Convert the seconds
> denominated timeouts to secs_to_jiffies()

There is very similar things with tcp_timeouts[] in 
nf_conntrack_proto_tcp.c, why not convert it as well ?

> 
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> ---
>   net/netfilter/nf_conntrack_proto_sctp.c | 21 ++++++++-------------
>   1 file changed, 8 insertions(+), 13 deletions(-)
> 
> diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
> index 4cc97f971264ed779434ab4597dd0162586b3736..6c95ac96fa42a39acafb5b88a7cf8898010e911c 100644
> --- a/net/netfilter/nf_conntrack_proto_sctp.c
> +++ b/net/netfilter/nf_conntrack_proto_sctp.c
> @@ -39,20 +39,15 @@ static const char *const sctp_conntrack_names[] = {
>          [SCTP_CONNTRACK_HEARTBEAT_SENT]         = "HEARTBEAT_SENT",
>   };
> 
> -#define SECS  * HZ
> -#define MINS  * 60 SECS
> -#define HOURS * 60 MINS
> -#define DAYS  * 24 HOURS
> -
>   static const unsigned int sctp_timeouts[SCTP_CONNTRACK_MAX] = {
> -       [SCTP_CONNTRACK_CLOSED]                 = 10 SECS,
> -       [SCTP_CONNTRACK_COOKIE_WAIT]            = 3 SECS,
> -       [SCTP_CONNTRACK_COOKIE_ECHOED]          = 3 SECS,
> -       [SCTP_CONNTRACK_ESTABLISHED]            = 210 SECS,
> -       [SCTP_CONNTRACK_SHUTDOWN_SENT]          = 3 SECS,
> -       [SCTP_CONNTRACK_SHUTDOWN_RECD]          = 3 SECS,
> -       [SCTP_CONNTRACK_SHUTDOWN_ACK_SENT]      = 3 SECS,
> -       [SCTP_CONNTRACK_HEARTBEAT_SENT]         = 30 SECS,
> +       [SCTP_CONNTRACK_CLOSED]                 = secs_to_jiffies(10),
> +       [SCTP_CONNTRACK_COOKIE_WAIT]            = secs_to_jiffies(3),
> +       [SCTP_CONNTRACK_COOKIE_ECHOED]          = secs_to_jiffies(3),
> +       [SCTP_CONNTRACK_ESTABLISHED]            = secs_to_jiffies(210),
> +       [SCTP_CONNTRACK_SHUTDOWN_SENT]          = secs_to_jiffies(3),
> +       [SCTP_CONNTRACK_SHUTDOWN_RECD]          = secs_to_jiffies(3),
> +       [SCTP_CONNTRACK_SHUTDOWN_ACK_SENT]      = secs_to_jiffies(3),
> +       [SCTP_CONNTRACK_HEARTBEAT_SENT]         = secs_to_jiffies(3),

Was 30 before, if you think it must be changed to 3 you must explain it 
in the commit message, or maybe do another patch for that change.

>   };
> 
>   #define        SCTP_FLAG_HEARTBEAT_VTAG_FAILED 1
> 
> --
> 2.34.1
> 

Christophe
Christophe Leroy Nov. 16, 2024, 10:06 a.m. UTC | #10
Le 15/11/2024 à 22:26, Easwar Hariharan a écrit :
> [Vous ne recevez pas souvent de courriers de eahariha@linux.microsoft.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> Changes made with the following Coccinelle rules:
> 
> @@ constant C; @@
> 
> - msecs_to_jiffies(C * 1000)
> + secs_to_jiffies(C)
> 
> @@ constant C; @@
> 
> - msecs_to_jiffies(C * MSEC_PER_SEC)
> + secs_to_jiffies(C)

Is it a special script or is it done with the script in patch 2.

That's nice to say how it is done, but you also have to say _what_ and 
_why_ you do it. This is even more important as you plan to get it 
merged independently in each tree instead of merging it as a single series.

It could be something like:

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

> 
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> ---
>   arch/powerpc/platforms/pseries/papr_scm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c
> index 9e297f88adc5d97d4dc7b267b0bfebd58e5cf193..9e8086ec66e0f0e555ac27933854c06cfcf91a04 100644
> --- a/arch/powerpc/platforms/pseries/papr_scm.c
> +++ b/arch/powerpc/platforms/pseries/papr_scm.c
> @@ -543,7 +543,7 @@ static int drc_pmem_query_health(struct papr_scm_priv *p)
> 
>          /* Jiffies offset for which the health data is assumed to be same */
>          cache_timeout = p->lasthealth_jiffies +
> -               msecs_to_jiffies(MIN_HEALTH_QUERY_INTERVAL * 1000);
> +               secs_to_jiffies(MIN_HEALTH_QUERY_INTERVAL);

Wouldn't it now fit on a single line ?

	cache_timeout = p->lasthealth_jiffies + 
secs_to_jiffies(MIN_HEALTH_QUERY_INTERVAL);


Also I'm not sure it is worth the MIN_HEALTH_QUERY_INTERVAL macro as it 
is defined localy and used only once, but that's another story.

> 
>          /* Fetch new health info is its older than MIN_HEALTH_QUERY_INTERVAL */
>          if (time_after(jiffies, cache_timeout))
> 
> --
> 2.34.1
>
Christophe Leroy Nov. 16, 2024, 10:10 a.m. UTC | #11
Le 15/11/2024 à 22:26, Easwar Hariharan a écrit :
> [Vous ne recevez pas souvent de courriers de eahariha@linux.microsoft.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> Changes made with the following Coccinelle rules:
> 
> @@ constant C; @@
> 
> - msecs_to_jiffies(C * 1000)
> + secs_to_jiffies(C)
> 
> @@ constant C; @@
> 
> - msecs_to_jiffies(C * MSEC_PER_SEC)
> + secs_to_jiffies(C)
> 
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> ---
>   samples/livepatch/livepatch-callbacks-busymod.c |  2 +-
>   samples/livepatch/livepatch-shadow-fix1.c       |  2 +-
>   samples/livepatch/livepatch-shadow-mod.c        | 10 +++++-----
>   3 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/samples/livepatch/livepatch-callbacks-busymod.c b/samples/livepatch/livepatch-callbacks-busymod.c
> index 378e2d40271a9717d09eff51d3d3612c679736fc..d0fd801a7c21b7d7939c29d83f9d993badcc9aba 100644
> --- a/samples/livepatch/livepatch-callbacks-busymod.c
> +++ b/samples/livepatch/livepatch-callbacks-busymod.c
> @@ -45,7 +45,7 @@ static int livepatch_callbacks_mod_init(void)
>   {
>          pr_info("%s\n", __func__);
>          schedule_delayed_work(&work,
> -               msecs_to_jiffies(1000 * 0));
> +               secs_to_jiffies(0));

Using secs_to_jiffies() is pointless, 0 is universal, should become 
schedule_delayed_work(&work, 0);

>          return 0;
>   }
> 
> diff --git a/samples/livepatch/livepatch-shadow-fix1.c b/samples/livepatch/livepatch-shadow-fix1.c
> index 6701641bf12d454a770e49abeeb0dea92560e55e..948ea1f5760fed2fa27baf478c97cf98ad5c99a8 100644
> --- a/samples/livepatch/livepatch-shadow-fix1.c
> +++ b/samples/livepatch/livepatch-shadow-fix1.c
> @@ -73,7 +73,7 @@ static struct dummy *livepatch_fix1_dummy_alloc(void)
>                  return NULL;
> 
>          d->jiffies_expire = jiffies +
> -               msecs_to_jiffies(1000 * EXPIRE_PERIOD);
> +               secs_to_jiffies(EXPIRE_PERIOD);
> 
>          /*
>           * Patch: save the extra memory location into a SV_LEAK shadow
> diff --git a/samples/livepatch/livepatch-shadow-mod.c b/samples/livepatch/livepatch-shadow-mod.c
> index 7e753b0d2fa611524c9e2adbe02c8fa3e9b6015e..79296e6ccb119f521e86a121623855d841c9fc5e 100644
> --- a/samples/livepatch/livepatch-shadow-mod.c
> +++ b/samples/livepatch/livepatch-shadow-mod.c
> @@ -102,7 +102,7 @@ static __used noinline struct dummy *dummy_alloc(void)
>                  return NULL;
> 
>          d->jiffies_expire = jiffies +
> -               msecs_to_jiffies(1000 * EXPIRE_PERIOD);
> +               secs_to_jiffies(EXPIRE_PERIOD);

Should fit on a single line, avoid multiple lines when possible.

> 
>          /* Oops, forgot to save leak! */
>          leak = kzalloc(sizeof(*leak), GFP_KERNEL);
> @@ -153,7 +153,7 @@ static void alloc_work_func(struct work_struct *work)
>          mutex_unlock(&dummy_list_mutex);
> 
>          schedule_delayed_work(&alloc_dwork,
> -               msecs_to_jiffies(1000 * ALLOC_PERIOD));
> +               secs_to_jiffies(ALLOC_PERIOD));

Should fit on a single line, avoid multiple lines when possible.


>   }
> 
>   /*
> @@ -185,15 +185,15 @@ static void cleanup_work_func(struct work_struct *work)
>          mutex_unlock(&dummy_list_mutex);
> 
>          schedule_delayed_work(&cleanup_dwork,
> -               msecs_to_jiffies(1000 * CLEANUP_PERIOD));
> +               secs_to_jiffies(CLEANUP_PERIOD));

Should fit on a single line, avoid multiple lines when possible.


>   }
> 
>   static int livepatch_shadow_mod_init(void)
>   {
>          schedule_delayed_work(&alloc_dwork,
> -               msecs_to_jiffies(1000 * ALLOC_PERIOD));
> +               secs_to_jiffies(ALLOC_PERIOD));

Should fit on a single line, avoid multiple lines when possible.


>          schedule_delayed_work(&cleanup_dwork,
> -               msecs_to_jiffies(1000 * CLEANUP_PERIOD));
> +               secs_to_jiffies(CLEANUP_PERIOD));

Should fit on a single line, avoid multiple lines when possible.


> 
>          return 0;
>   }
> 
> --
> 2.34.1
>
Christophe Leroy Nov. 16, 2024, 10:16 a.m. UTC | #12
Le 15/11/2024 à 22:26, Easwar Hariharan a écrit :
> [Vous ne recevez pas souvent de courriers de eahariha@linux.microsoft.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> This is a series that follows up on my previous series to introduce
> secs_to_jiffies() and convert a few initial users.[1] In the review for
> that series, Anna-Maria requested converting other users with
> Coccinelle. This is part 1 that converts users of msecs_to_jiffies()
> that use the multiply pattern of either of:
> - msecs_to_jiffies(N*1000), or
> - msecs_to_jiffies(N*MSEC_PER_SEC)

You should provide a reference to the accepted commit that adds 
secs_to_jiffies:

Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()")

> 
> The entire conversion is made with Coccinelle in the script added in
> patch 2. Some changes suggested by Coccinelle have been deferred to
> later parts that will address other possible variant patterns.
> 
> CC: Anna-Maria Behnsen <anna-maria@linutronix.de>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> 
> [1] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fall%2F20241030-open-coded-timeouts-v3-0-9ba123facf88%40linux.microsoft.com%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7C121622b159564a010cac08dd05bc32da%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638673028056187739%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=oW04hGIpfjRo8qcX0GaGdHE1xiApgoOtgAuWQXFgWR4%3D&reserved=0
> [2] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fall%2F8734kngfni.fsf%40somnus%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7C121622b159564a010cac08dd05bc32da%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638673028056211741%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=UDn89U6oUNFiRj3K5fvNEIuiwmwEGfJ2XhPn43z8%2BhA%3D&reserved=0
> 
> ---
> Changes in v2:
> - EDITME: describe what is new in this series revision.
> - EDITME: use bulletpoints and terse descriptions.
> - Link to v1: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fr%2F20241115-converge-secs-to-jiffies-v1-0-19aadc34941b%40linux.microsoft.com&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7C121622b159564a010cac08dd05bc32da%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638673028056225723%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=reWzZOiSyn%2FA5qxcXAoUqNGedJ1K%2FM%2BuCgEKwXusuU8%3D&reserved=0
> 
> ---
> Easwar Hariharan (21):
>        netfilter: conntrack: Cleanup timeout definitions
>        coccinelle: misc: Add secs_to_jiffies script
>        arm: pxa: Convert timeouts to use secs_to_jiffies()
>        s390: kernel: Convert timeouts to use secs_to_jiffies()
>        powerpc/papr_scm: Convert timeouts to secs_to_jiffies()
>        mm: kmemleak: Convert timeouts to secs_to_jiffies()
>        accel/habanalabs: Convert timeouts to secs_to_jiffies()
>        drm/xe: Convert timeout to secs_to_jiffies()
>        drm/etnaviv: Convert timeouts to secs_to_jiffies()
>        scsi: lpfc: Convert timeouts to secs_to_jiffies()
>        scsi: arcmsr: Convert timeouts to secs_to_jiffies()
>        scsi: pm8001: Convert timeouts to secs_to_jiffies()
>        xen/blkback: Convert timeouts to secs_to_jiffies()
>        gve: Convert timeouts to secs_to_jiffies()
>        wifi: ath11k: Convert timeouts to secs_to_jiffies()
>        Bluetooth: MGMT: Convert timeouts to secs_to_jiffies()
>        staging: vc04_services: Convert timeouts to secs_to_jiffies()
>        ceph: Convert timeouts to secs_to_jiffies()
>        livepatch: Convert timeouts to secs_to_jiffies()
>        ALSA: line6: Convert timeouts to secs_to_jiffies()
>        nfp: Convert timeouts to secs_to_jiffies()
> 
>   arch/arm/mach-pxa/sharpsl_pm.c                      |  6 +++---
>   arch/powerpc/platforms/pseries/papr_scm.c           |  2 +-
>   arch/s390/kernel/lgr.c                              |  3 ++-
>   arch/s390/kernel/time.c                             |  4 ++--
>   arch/s390/kernel/topology.c                         |  2 +-
>   drivers/accel/habanalabs/common/device.c            |  2 +-
>   drivers/accel/habanalabs/common/habanalabs_drv.c    |  3 +--
>   drivers/block/xen-blkback/blkback.c                 |  2 +-
>   drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c            |  2 +-
>   drivers/gpu/drm/xe/xe_device.c                      |  2 +-
>   drivers/net/ethernet/google/gve/gve_tx_dqo.c        |  6 ++----
>   drivers/net/ethernet/netronome/nfp/nfp_net_common.c |  2 +-
>   drivers/net/wireless/ath/ath11k/debugfs.c           |  2 +-
>   drivers/scsi/arcmsr/arcmsr_hba.c                    |  2 +-
>   drivers/scsi/lpfc/lpfc_init.c                       | 18 +++++++++---------
>   drivers/scsi/lpfc/lpfc_nportdisc.c                  |  8 ++++----
>   drivers/scsi/lpfc/lpfc_nvme.c                       |  2 +-
>   drivers/scsi/lpfc/lpfc_sli.c                        |  4 ++--
>   drivers/scsi/lpfc/lpfc_vmid.c                       |  2 +-
>   drivers/scsi/pm8001/pm8001_init.c                   |  2 +-
>   .../vc04_services/bcm2835-audio/bcm2835-vchiq.c     |  2 +-
>   fs/ceph/quota.c                                     |  2 +-
>   mm/kmemleak.c                                       |  4 ++--
>   net/bluetooth/mgmt.c                                |  2 +-
>   net/netfilter/nf_conntrack_proto_sctp.c             | 21 ++++++++-------------
>   samples/livepatch/livepatch-callbacks-busymod.c     |  2 +-
>   samples/livepatch/livepatch-shadow-fix1.c           |  2 +-
>   samples/livepatch/livepatch-shadow-mod.c            | 10 +++++-----
>   scripts/coccinelle/misc/secs_to_jiffies.cocci       | 21 +++++++++++++++++++++
>   sound/usb/line6/toneport.c                          |  2 +-
>   30 files changed, 79 insertions(+), 65 deletions(-)
> ---
> base-commit: 2d5404caa8c7bb5c4e0435f94b28834ae5456623
> change-id: 20241112-converge-secs-to-jiffies-d99d1016bd11
> 
> Best regards,
> --
> Easwar Hariharan <eahariha@linux.microsoft.com>
>
LEROY Christophe Nov. 16, 2024, 10:23 a.m. UTC | #13
Le 15/11/2024 à 22:26, Easwar Hariharan a écrit :
> [Vous ne recevez pas souvent de courriers de eahariha@linux.microsoft.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
>
> This is a series that follows up on my previous series to introduce
> secs_to_jiffies() and convert a few initial users.[1] In the review for
> that series, Anna-Maria requested converting other users with
> Coccinelle. This is part 1 that converts users of msecs_to_jiffies()
> that use the multiply pattern of either of:
> - msecs_to_jiffies(N*1000), or
> - msecs_to_jiffies(N*MSEC_PER_SEC)

After applying this series on top of tip/timers/core tree, I still find
a lot of candidates to the conversion:

Documentation/driver-api/media/dtv-frontend.rst:
state->per_jiffies_stats = jiffies + msecs_to_jiffies(1000);
arch/arm/kernel/smp.c:                                           msecs_to_jiffies(1000));
arch/arm/mach-imx/src.c:        timeout = jiffies + msecs_to_jiffies(1000);
arch/mips/kernel/smp.c:                                  msecs_to_jiffies(1000))) {
arch/openrisc/kernel/smp.c:                                     msecs_to_jiffies(1000))) {
arch/riscv/kernel/smpboot.c:                                        msecs_to_jiffies(1000));
arch/xtensa/kernel/smp.c:       unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
arch/xtensa/kernel/smp.c:                               msecs_to_jiffies(1000));
arch/xtensa/kernel/smp.c:       unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
block/bfq-iosched.c:                msecs_to_jiffies(10000))) {
block/bfq-iosched.c:                                         msecs_to_jiffies(1000)))
drivers/accel/habanalabs/common/command_submission.c:                   ?
msecs_to_jiffies(args->in.timeout * 1000)
drivers/accel/habanalabs/common/debugfs.c:              hdev->timeout_jiffies =
msecs_to_jiffies(value * 1000);
drivers/accel/habanalabs/common/device.c:
msecs_to_jiffies(hdev->device_release_watchdog_timeout_sec * 1000));
drivers/ata/libata-zpodd.c:               msecs_to_jiffies(zpodd_poweroff_delay *
1000);
drivers/auxdisplay/arm-charlcd.c:#define CHARLCD_TIMEOUT
(msecs_to_jiffies(1000))
drivers/block/mtip32xx/mtip32xx.c:      timeout = jiffies +
msecs_to_jiffies(10000);
drivers/block/mtip32xx/mtip32xx.c:                                                      msecs_to_jiffies(1000);
drivers/block/rbd.c:#define RBD_RETRY_DELAY             msecs_to_jiffies(1000)
drivers/block/rbd.c:            opt->lock_timeout =
msecs_to_jiffies(result.uint_32 * 1000);
drivers/bluetooth/btnxpuart.c:                                         msecs_to_jiffies(1000));
drivers/bluetooth/hci_bcm4377.c:#define BCM4377_TIMEOUT
msecs_to_jiffies(1000)
drivers/bluetooth/hci_intel.c:                            msecs_to_jiffies(1000));
drivers/bluetooth/hci_intel.c:                            msecs_to_jiffies(1000));
drivers/bluetooth/hci_nokia.c:          msecs_to_jiffies(1000))) {
drivers/bluetooth/hci_nokia.c:          msecs_to_jiffies(10000))) {
drivers/bluetooth/hci_vhci.c:   hdev->dump.timeout =
msecs_to_jiffies(timeout * 1000);
drivers/bluetooth/hci_vhci.c:   schedule_delayed_work(&data->open_timeout,
msecs_to_jiffies(1000));
drivers/char/agp/intel-gtt.c:   unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
drivers/comedi/drivers/jr3_pci.c:       devpriv->timer.expires = jiffies +
msecs_to_jiffies(1000);
drivers/crypto/intel/qat/qat_common/adf_aer.c:  unsigned long
wait_jiffies = msecs_to_jiffies(10000);
drivers/crypto/intel/qat/qat_common/adf_aer.c:          unsigned long
wait_jiffies = msecs_to_jiffies(10000);
drivers/crypto/mxs-dcp.c:                                         msecs_to_jiffies(1000));
drivers/crypto/starfive/jh7110-aes.c:                                    msecs_to_jiffies(1000)))
drivers/crypto/starfive/jh7110-hash.c:                                   msecs_to_jiffies(1000)))
drivers/crypto/stm32/stm32-cryp.c:      if
(!wait_for_completion_timeout(&cryp->dma_completion,
msecs_to_jiffies(1000))) {
drivers/dma/plx_dma.c:  unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
drivers/dma/ti/k3-udma.c:       unsigned long timeout = msecs_to_jiffies(1000);
drivers/dma/xilinx/xdma.c:
wait_for_completion_timeout(&xdma_chan->last_interrupt,
msecs_to_jiffies(1000));
drivers/fpga/xilinx-core.c:     unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:
msecs_to_jiffies(1000));
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:     adev->gfx_timeout =
msecs_to_jiffies(10000);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:                                     msecs_to_jiffies(60000)
: msecs_to_jiffies(10000);
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c:#define AMDGPU_IB_TEST_TIMEOUT
msecs_to_jiffies(1000)
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c:#define JPEG_IDLE_TIMEOUT
msecs_to_jiffies(1000)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:#define UVD_IDLE_TIMEOUT
msecs_to_jiffies(1000)
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:#define VCE_IDLE_TIMEOUT
msecs_to_jiffies(1000)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h:#define VCN_IDLE_TIMEOUT
msecs_to_jiffies(1000)
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c:#define VPE_IDLE_TIMEOUT
msecs_to_jiffies(1000)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c: long tmo = msecs_to_jiffies(1000);
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c: long tmo = msecs_to_jiffies(1000);
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c: long tmo = msecs_to_jiffies(1000);
drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c:
msecs_to_jiffies(1000));
drivers/gpu/drm/bridge/ite-it6505.c:                                        msecs_to_jiffies(1000));
drivers/gpu/drm/etnaviv/etnaviv_gpu.c:  timeout = jiffies +
msecs_to_jiffies(1000);
drivers/gpu/drm/etnaviv/etnaviv_gpu.c:  unsigned long timeout =
msecs_to_jiffies(10 * 10000);
drivers/gpu/drm/gma500/cdv_intel_crt.c:         timeout = jiffies +
msecs_to_jiffies(1000);
drivers/gpu/drm/i915/display/intel_drrs.c:
mod_delayed_work(i915->unordered_wq, &crtc->drrs.work,
msecs_to_jiffies(1000));
drivers/gpu/drm/i915/display/intel_lspcon.c:            if (time_after(jiffies,
start + msecs_to_jiffies(1000)))
drivers/gpu/drm/i915/display/intel_tc.c:                                   msecs_to_jiffies(1000));
drivers/gpu/drm/msm/adreno/a5xx_preempt.c:
mod_timer(&a5xx_gpu->preempt_timer, jiffies + msecs_to_jiffies(10000));
drivers/gpu/drm/msm/adreno/a6xx_gpu.c:  if
(!wait_for_completion_timeout(&gmu->pd_gate, msecs_to_jiffies(1000)))
drivers/gpu/drm/msm/adreno/adreno_device.c:
msecs_to_jiffies(1000));
drivers/gpu/drm/msm/adreno/adreno_gpu.h:#define ADRENO_IDLE_TIMEOUT
msecs_to_jiffies(1000)
drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c:
msecs_to_jiffies(1000));
drivers/gpu/drm/nouveau/nvkm/engine/sec2/ga102.c:
msecs_to_jiffies(1000));
drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp102.c:
msecs_to_jiffies(1000));
drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c:                                      msecs_to_jiffies(1000))) {
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c:                                    &pmu->subdev,
msecs_to_jiffies(1000));
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp10b.c:                                    &pmu->subdev,
msecs_to_jiffies(1000));
drivers/gpu/drm/panfrost/panfrost_perfcnt.c:                                                    msecs_to_jiffies(1000));
drivers/gpu/drm/panfrost/panfrost_perfcnt.c:                                      msecs_to_jiffies(1000));
drivers/gpu/drm/panthor/panthor_fw.c:                           msecs_to_jiffies(1000))) {
drivers/gpu/drm/radeon/radeon_connectors.c:
msecs_to_jiffies(1000));
drivers/gpu/drm/radeon/radeon_connectors.c:
schedule_delayed_work(&rdev->hotplug_work, msecs_to_jiffies(1000));
drivers/gpu/drm/tegra/hub.c:    timeout = jiffies + msecs_to_jiffies(1000);
drivers/gpu/drm/tegra/hub.c:    timeout = jiffies + msecs_to_jiffies(1000);
drivers/gpu/drm/tegra/submit.c:         err = dma_fence_wait_timeout(fence,
true, msecs_to_jiffies(10000));
drivers/gpu/drm/vc4/vc4_bo.c:   unsigned long expire_time = jiffies -
msecs_to_jiffies(1000);
drivers/gpu/drm/vc4/vc4_bo.c:                                              msecs_to_jiffies(1000)));
drivers/gpu/drm/vc4/vc4_dsi.c:                                   msecs_to_jiffies(1000))) {
drivers/gpu/drm/vc4/vc4_txp.c:          unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
drivers/gpu/drm/xe/xe_execlist.c:       port->irq_fail.expires = jiffies +
msecs_to_jiffies(1000);
drivers/gpu/drm/xe/xe_execlist.c:       port->irq_fail.expires = jiffies +
msecs_to_jiffies(1000);
drivers/gpu/ipu-v3/ipu-common.c:        timeout = jiffies + msecs_to_jiffies(1000);
drivers/gpu/ipu-v3/ipu-image-convert.c:                                   msecs_to_jiffies(10000));
drivers/gpu/ipu-v3/ipu-image-convert.c: ret =
wait_for_completion_timeout(&comp, msecs_to_jiffies(10000));
drivers/hid/hid-rmi.c:                                  msecs_to_jiffies(1000))) {
drivers/hid/i2c-hid/i2c-hid-core.c:                                    msecs_to_jiffies(1000))) {
drivers/hid/usbhid/hid-core.c:          usbhid->stop_retry = jiffies +
msecs_to_jiffies(1000);
drivers/hid/wacom_sys.c:        schedule_delayed_work(&wacom->init_work,
msecs_to_jiffies(1000));
drivers/hwmon/occ/common.c:#define OCC_UPDATE_FREQUENCY
msecs_to_jiffies(1000)
drivers/i2c/busses/i2c-cadence.c:#define CDNS_I2C_TIMEOUT
msecs_to_jiffies(1000)
drivers/i2c/busses/i2c-cadence.c:       msg_timeout = msecs_to_jiffies((1000 *
msg->len * BITS_PER_BYTE) / id->i2c_clk);
drivers/i2c/busses/i2c-eg20t.c:                 (adap->pch_event_flag != 0),
msecs_to_jiffies(1000));
drivers/i2c/busses/i2c-img-scb.c:#define IMG_I2C_TIMEOUT
(msecs_to_jiffies(1000))
drivers/i2c/busses/i2c-lpc2k.c: unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
drivers/i2c/busses/i2c-lpc2k.c:                        msecs_to_jiffies(1000)) == 0) {
drivers/i2c/busses/i2c-mxs.c:   unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
drivers/i2c/busses/i2c-mxs.c:                                           msecs_to_jiffies(1000));
drivers/i2c/busses/i2c-omap.c:#define OMAP_I2C_TIMEOUT
(msecs_to_jiffies(1000))
drivers/i2c/busses/i2c-viai2c-common.h:#define VIAI2C_TIMEOUT
(msecs_to_jiffies(1000))
drivers/i2c/busses/i2c-xiic.c:#define XIIC_I2C_TIMEOUT
(msecs_to_jiffies(1000))
drivers/i2c/busses/i2c-xiic.c:#define XIIC_XFER_TIMEOUT
(msecs_to_jiffies(10000))
drivers/i3c/master/dw-i3c-master.c:#define XFER_TIMEOUT
(msecs_to_jiffies(1000))
drivers/i3c/master/i3c-master-cdns.c:   if
(!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000)))
drivers/i3c/master/i3c-master-cdns.c:                                    msecs_to_jiffies(1000)))
drivers/i3c/master/i3c-master-cdns.c:   if
(!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000)))
drivers/i3c/master/svc-i3c-master.c:            if (time_after(jiffies, start +
msecs_to_jiffies(1000))) {
drivers/i3c/master/svc-i3c-master.c:    if
(!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000)))
drivers/i3c/master/svc-i3c-master.c:    if
(!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000)))
drivers/i3c/master/svc-i3c-master.c:    if
(!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000)))
drivers/i3c/master/svc-i3c-master.c:    if
(!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000)))
drivers/iio/accel/bmc150-accel-i2c.c:
schedule_delayed_work(&data->resume_work, msecs_to_jiffies(1000));
drivers/iio/adc/ad4130.c:                                         msecs_to_jiffies(1000));
drivers/iio/adc/ad7606.c:                                         msecs_to_jiffies(1000));
drivers/iio/adc/ad7768-1.c:                                       msecs_to_jiffies(1000));
drivers/iio/adc/at91-sama5d2_adc.c:                                            msecs_to_jiffies(1000));
drivers/iio/adc/at91_adc.c:                                                    msecs_to_jiffies(1000));
drivers/iio/adc/berlin2-adc.c:                                         msecs_to_jiffies(1000));
drivers/iio/adc/berlin2-adc.c:                                         msecs_to_jiffies(1000));
drivers/iio/adc/intel_mrfld_adc.c:#define BCOVE_ADC_TIMEOUT
msecs_to_jiffies(1000)
drivers/iio/adc/max1027.c:                                                msecs_to_jiffies(1000));
drivers/iio/adc/nau7802.c:                      msecs_to_jiffies(1000));
drivers/iio/adc/stmpe-adc.c:#define STMPE_ADC_TIMEOUT
msecs_to_jiffies(1000)
drivers/iio/adc/sun4i-gpadc-iio.c:                                       msecs_to_jiffies(1000))) {
drivers/iio/addac/ad74115.c:                                              msecs_to_jiffies(1000));
drivers/iio/addac/ad74413r.c:                                     msecs_to_jiffies(1000));
drivers/iio/chemical/scd30_core.c:      timeout =
msecs_to_jiffies(state->meas_interval * (1000 + SCD30_EXTRA_TIMEOUT_PER_S));
drivers/iio/light/gp2ap020a00f.c:#define GP2AP020A00F_DATA_READY_TIMEOUT
        msecs_to_jiffies(1000)
drivers/iio/magnetometer/ak8974.c:                                      1 + msecs_to_jiffies(1000));
drivers/infiniband/core/mad_rmpp.c:                        &rmpp_recv->cleanup_work,
msecs_to_jiffies(10000));
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c:
msecs_to_jiffies(rcfw->max_timeout * 1000));
drivers/infiniband/hw/mlx4/alias_GUID.c:
msecs_to_jiffies(resched_delay_sec * 1000));
drivers/infiniband/hw/mlx5/mr.c:                                           msecs_to_jiffies(1000));
drivers/infiniband/hw/mlx5/mr.c:                                                   msecs_to_jiffies(1000));
drivers/infiniband/hw/mlx5/mr.c:                                         msecs_to_jiffies(30 * 1000));
drivers/infiniband/hw/ocrdma/ocrdma_hw.c:
schedule_delayed_work(&dev->eqd_work, msecs_to_jiffies(1000));
drivers/infiniband/hw/ocrdma/ocrdma_main.c:
schedule_delayed_work(&dev->eqd_work, msecs_to_jiffies(1000));
drivers/infiniband/ulp/srp/ib_srp.c:    rq_tmo_jiffies =
msecs_to_jiffies(max_compl_time_ms + 1000);
drivers/input/rmi4/rmi_f54.c:                                            msecs_to_jiffies(1000))) {
drivers/input/serio/ps2-gpio.c:                                          msecs_to_jiffies(10000)))
drivers/input/serio/sun4i-ps2.c:        unsigned long expire = jiffies +
msecs_to_jiffies(10000);
drivers/input/touchscreen/stmfts.c:                                      msecs_to_jiffies(1000)))
drivers/input/touchscreen/zforce_ts.c:#define WAIT_TIMEOUT
msecs_to_jiffies(1000)
drivers/iommu/iommufd/main.c:                           msecs_to_jiffies(10000)))
drivers/mailbox/pl320-ipc.c:                                      msecs_to_jiffies(1000));
drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c:
     msecs_to_jiffies(1000));
drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c:
    msecs_to_jiffies(1000));
drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c:
     msecs_to_jiffies(1000));
drivers/media/dvb-frontends/cx24120.c:          state->per_jiffies_stats =
jiffies + msecs_to_jiffies(1000);
drivers/media/dvb-frontends/cxd2841er.c:                priv->stats_time = jiffies +
msecs_to_jiffies(1000);
drivers/media/dvb-frontends/dib7000p.c:         state->per_jiffies_stats =
jiffies + msecs_to_jiffies(1000);
drivers/media/dvb-frontends/dib8000.c:          state->per_jiffies_stats =
jiffies + msecs_to_jiffies(1000);
drivers/media/dvb-frontends/lgdt330x.c: state->last_stats_time = jiffies
+ msecs_to_jiffies(1000);
drivers/media/dvb-frontends/lgdt330x.c: state->last_stats_time = jiffies
+ msecs_to_jiffies(1000);
drivers/media/dvb-frontends/mb86a20s.c:                                            msecs_to_jiffies(1000);
drivers/media/dvb-frontends/sp2.c:              s->next_status_checked_time =
jiffies +       msecs_to_jiffies(1000);
drivers/media/i2c/ds90ub960.c:  timeout = jiffies + msecs_to_jiffies(1000);
drivers/media/pci/bt8xx/bttv-input.c:           ir->timer.expires  = jiffies +
msecs_to_jiffies(1000);
drivers/media/pci/bt8xx/bttvp.h:#define BTTV_FREE_IDLE
msecs_to_jiffies(1000)   /* one second */
drivers/media/pci/cx18/cx18-fileops.c:                  if (time_after(jiffies,
cx->dualwatch_jiffies + msecs_to_jiffies(1000))) {
drivers/media/pci/cx23885/cimax2.c:                     + msecs_to_jiffies(1000);
drivers/media/pci/cx88/cx88-blackbird.c:        timeout = jiffies +
msecs_to_jiffies(1000);
drivers/media/pci/ivtv/ivtv-fileops.c:                                 msecs_to_jiffies(1000))) {
drivers/media/pci/ivtv/ivtv-mailbox.c:  int api_timeout =
msecs_to_jiffies(1000);
drivers/media/pci/mgb4/mgb4_dma.c:                                       msecs_to_jiffies(10000))) {
drivers/media/pci/netup_unidvb/netup_unidvb_core.c:
mod_timer(&dma->timeout, jiffies + msecs_to_jiffies(1000));
drivers/media/pci/saa7134/saa7134.h:#define TS_BUFFER_TIMEOUT
msecs_to_jiffies(1000)  /* 1 second */
drivers/media/pci/tw5864/tw5864-core.c: input->new_frame_deadline =
jiffies + msecs_to_jiffies(1000);
drivers/media/platform/amphion/vpu.h:#define VPU_TIMEOUT
msecs_to_jiffies(1000)
drivers/media/platform/aspeed/aspeed-video.c:#define STOP_TIMEOUT
msecs_to_jiffies(1000)
drivers/media/platform/chips-media/coda/coda-bit.c:     unsigned long
timeout = jiffies + msecs_to_jiffies(1000);
drivers/media/platform/chips-media/coda/coda-common.c:
msecs_to_jiffies(1000))) {
drivers/media/platform/nvidia/tegra-vde/h264.c:
&vde->decode_completion, msecs_to_jiffies(1000));
drivers/media/platform/qcom/venus/hfi.c:#define TIMEOUT
msecs_to_jiffies(1000)
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c:
msecs_to_jiffies(1000));
drivers/media/platform/ti/omap3isp/isp.c:#define ISP_STOP_TIMEOUT
msecs_to_jiffies(1000)
drivers/media/platform/ti/omap3isp/isp.c:                                       msecs_to_jiffies(1000))) {
drivers/media/radio/radio-wl1273.c:     t =
wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000));
drivers/media/radio/radio-wl1273.c:
wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000));
drivers/media/radio/radio-wl1273.c:     if
(!wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000)))
drivers/media/radio/tea575x.c:  timeout = jiffies + msecs_to_jiffies(10000);
drivers/media/tuners/si2157.c:  schedule_delayed_work(&dev->stat_work,
msecs_to_jiffies(1000));
drivers/media/usb/dvb-usb-v2/af9015.c:  for (val = 0x00, timeout =
jiffies + msecs_to_jiffies(1000);
drivers/media/usb/dvb-usb-v2/anysee.c:  state->ci_cam_ready = jiffies +
msecs_to_jiffies(1000);
drivers/media/usb/hdpvr/hdpvr-video.c:                          msecs_to_jiffies(1000));
drivers/memstick/host/jmb38x_ms.c:      host->timeout_jiffies =
msecs_to_jiffies(1000);
drivers/memstick/host/r592.c:   unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
drivers/memstick/host/r592.c:                   &dev->dma_done, msecs_to_jiffies(1000))) {
drivers/memstick/host/tifm_ms.c:        host->timeout_jiffies =
msecs_to_jiffies(1000);
drivers/misc/cxl/guest.c:       schedule_delayed_work(&afu->guest->work_err,
msecs_to_jiffies(1000));
drivers/misc/pci_endpoint_test.c:                                         msecs_to_jiffies(1000));
drivers/misc/pci_endpoint_test.c:                                         msecs_to_jiffies(1000));
drivers/mmc/host/meson-mx-sdio.c:               timeout = msecs_to_jiffies(1000);
drivers/mmc/host/moxart-mmc.c:  host->timeout = msecs_to_jiffies(1000);
drivers/mmc/host/sh_mmcif.c:    host->timeout   = msecs_to_jiffies(10000);
drivers/mmc/host/sunxi-mmc.c:   unsigned long expire = jiffies +
msecs_to_jiffies(1000);
drivers/mtd/hyperbus/hbmc-am654.c:      if
(!wait_for_completion_timeout(&priv->rx_dma_complete,
msecs_to_jiffies(len + 1000))) {
drivers/mtd/nand/ecc-mxic.c:                                              msecs_to_jiffies(1000));
drivers/mtd/nand/raw/cadence-nand-controller.c: unsigned long timeout =
msecs_to_jiffies(10000);
drivers/mtd/nand/raw/denali.c:                                          msecs_to_jiffies(1000));
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c:     to =
wait_for_completion_timeout(dma_completion, msecs_to_jiffies(1000));
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c:             to =
wait_for_completion_timeout(bch_completion, msecs_to_jiffies(1000));
drivers/mtd/nand/raw/intel-nand-controller.c:   time_left =
wait_for_completion_timeout(dma_completion, msecs_to_jiffies(1000));
drivers/mtd/nand/raw/lpc32xx_mlc.c:
wait_for_completion_timeout(&host->comp_dma, msecs_to_jiffies(1000));
drivers/mtd/nand/raw/lpc32xx_slc.c:
wait_for_completion_timeout(&host->comp, msecs_to_jiffies(1000));
drivers/mtd/nand/raw/r852.c:                            msecs_to_jiffies(1000));
drivers/mtd/nand/raw/r852.c:            &dev->card_detect_work,
msecs_to_jiffies(1000));
drivers/net/amt.c:      mod_delayed_work(amt_wq, &amt->req_wq,
msecs_to_jiffies(exp * 1000));
drivers/net/arcnet/arcnet.c:    mod_timer(&lp->timer, jiffies +
msecs_to_jiffies(1000));
drivers/net/arcnet/arcnet.c:                    mod_timer(&lp->timer, jiffies +
msecs_to_jiffies(1000));
drivers/net/can/kvaser_pciefd.c:#define KVASER_PCIEFD_WAIT_TIMEOUT
msecs_to_jiffies(1000)
drivers/net/can/sja1000/peak_pcmcia.c:
msecs_to_jiffies(PCC_SPI_MAX_BUSY_WAIT_MS) + 1;
drivers/net/ethernet/broadcom/bnxt/bnxt.h:#define
BNXT_SRIOV_CFG_WAIT_TMO msecs_to_jiffies(10000)
drivers/net/ethernet/cavium/liquidio/lio_main.c:#define
WAIT_INFLIGHT_REQUEST   msecs_to_jiffies(1000)
drivers/net/ethernet/cavium/liquidio/lio_main.c:
wait_for_completion_timeout(&first_stage, msecs_to_jiffies(1000));
drivers/net/ethernet/emulex/benet/be_main.c:    queue_delayed_work(be_wq,
&adapter->work, msecs_to_jiffies(1000));
drivers/net/ethernet/emulex/benet/be_main.c:    queue_delayed_work(be_wq,
&adapter->work, msecs_to_jiffies(1000));
drivers/net/ethernet/ibm/ehea/ehea_main.c:
round_jiffies_relative(msecs_to_jiffies(1000)));
drivers/net/ethernet/ibm/ehea/ehea_main.c:
round_jiffies_relative(msecs_to_jiffies(1000)));
drivers/net/ethernet/intel/ice/ice_eswitch_br.c:#define
ICE_ESW_BRIDGE_UPDATE_INTERVAL msecs_to_jiffies(1000)
drivers/net/ethernet/intel/idpf/idpf_lib.c:                        msecs_to_jiffies(10000));
drivers/net/ethernet/marvell/prestera/prestera_counter.c:#define
COUNTER_POLL_TIME       (msecs_to_jiffies(1000))
drivers/net/ethernet/mediatek/mtk_eth_soc.h:#define
MTK_DMA_MONITOR_TIMEOUT         msecs_to_jiffies(1000)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c:  poll_end = jiffies +
msecs_to_jiffies(cmd_to_ms + 1000);
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c:#define
MLX5_IPSEC_RESCHED msecs_to_jiffies(1000)
drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c:#define
MLX5_FC_STATS_PERIOD msecs_to_jiffies(1000)
drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c:#define
MLX5_FC_BULK_QUERY_ALLOC_PERIOD msecs_to_jiffies(180 * 1000)
drivers/net/ethernet/netronome/nfp/flower/qos_conf.c:#define
NFP_FL_QOS_UPDATE               msecs_to_jiffies(1000)
drivers/net/ethernet/ti/am65-cpsw-nuss.c:                                       msecs_to_jiffies(1000));
drivers/net/ethernet/ti/am65-cpsw-nuss.c:               i =
wait_for_completion_timeout(&common->tdown_complete,
msecs_to_jiffies(1000));
drivers/net/ethernet/ti/icssg/icssg_prueth.c:                                     msecs_to_jiffies(1000));
drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c:
msecs_to_jiffies(1000));
drivers/net/ethernet/ti/icssg/icssg_stats.c:
msecs_to_jiffies((STATS_TIME_LIMIT_1G_MS * 1000) / emac->speed));
drivers/net/ethernet/vertexcom/mse102x.c:       unsigned long work_timeout =
jiffies + msecs_to_jiffies(1000);
drivers/net/ieee802154/ca8210.c:                        msecs_to_jiffies(1000)
drivers/net/phy/sfp.c:#define T_FAULT_RECOVER           msecs_to_jiffies(1000)
drivers/net/phy/sfp.c:  sfp->phy_t_retry = msecs_to_jiffies(1000);
drivers/net/pse-pd/pd692x0.c:   timeout = msecs_to_jiffies(10000) + jiffies;
drivers/net/thunderbolt/main.c:                    msecs_to_jiffies(1000));
drivers/net/wireless/ath/wil6210/wil6210.h:#define WIL6210_SCAN_TO
msecs_to_jiffies(10000)
drivers/net/wireless/intel/iwlegacy/4965-mac.c:           jiffies +
msecs_to_jiffies(recalib_seconds * 1000));
drivers/net/wireless/intel/iwlwifi/dvm/rx.c:
msecs_to_jiffies(reg_recalib_period * 1000));
drivers/net/wireless/intel/iwlwifi/fw/debugfs.c:        fwrt->timestamp.delay =
msecs_to_jiffies(delay * 1000);
drivers/net/wireless/intersil/p54/p54usb.c:     timeout = jiffies +
msecs_to_jiffies(1000);
drivers/net/wireless/intersil/p54/p54usb.c:     timeout = jiffies +
msecs_to_jiffies(1000);
drivers/net/wireless/mediatek/mt7601u/mcu.c:    if
(!wait_for_completion_timeout(&cmpl, msecs_to_jiffies(1000))) {
drivers/net/wireless/microchip/wilc1000/hif.c:
mod_timer(&vif->periodic_rssi, jiffies + msecs_to_jiffies(5000));
drivers/net/wireless/microchip/wilc1000/hif.c:
mod_timer(&vif->periodic_rssi, jiffies + msecs_to_jiffies(5000));
drivers/net/wireless/microchip/wilc1000/netdev.c:
msecs_to_jiffies(5000)))
drivers/net/wireless/microchip/wilc1000/wlan.h:#define
WILC_CFG_PKTS_TIMEOUT   msecs_to_jiffies(3000)
drivers/net/wireless/silabs/wfx/data_tx.c:
msecs_to_jiffies(1000)) <= 0)
drivers/nfc/s3fwrn5/firmware.c:         &fw_info->completion,
msecs_to_jiffies(1000));
drivers/nfc/st95hf/spi.c:                                            msecs_to_jiffies(1000));
drivers/ntb/hw/amd/ntb_hw_amd.h:#define AMD_LINK_HB_TIMEOUT
msecs_to_jiffies(1000)
drivers/nvme/host/core.c:                               msecs_to_jiffies(admin_timeout * 1000);
drivers/pci/endpoint/functions/pci-epf-mhi.c:   ret =
wait_for_completion_timeout(&complete, msecs_to_jiffies(1000));
drivers/pci/endpoint/functions/pci-epf-mhi.c:   ret =
wait_for_completion_timeout(&complete, msecs_to_jiffies(1000));
drivers/pci/hotplug/shpchp_hpc.c:       unsigned long timeout =
msecs_to_jiffies(1000);
drivers/phy/freescale/phy-fsl-lynx-28g.c:                          msecs_to_jiffies(1000));
drivers/phy/freescale/phy-fsl-lynx-28g.c:                          msecs_to_jiffies(1000));
drivers/phy/motorola/phy-cpcap-usb.c:                                 msecs_to_jiffies(1000));
drivers/phy/rockchip/phy-rockchip-pcie.c:       timeout = jiffies +
msecs_to_jiffies(1000);
drivers/platform/chrome/cros_typec_switch.c:    end = jiffies +
msecs_to_jiffies(1000);
drivers/platform/surface/surface_dtx.c: sdtx_update_device_state(ddev,
msecs_to_jiffies(1000));
drivers/platform/x86/amd/pmf/acpi.c:
schedule_delayed_work(&dev->heart_beat,
msecs_to_jiffies(dev->hb_interval * 1000));
drivers/platform/x86/dell/dell-uart-backlight.c:#define DELL_BL_TIMEOUT
msecs_to_jiffies(1000)
drivers/platform/x86/thinkpad_acpi.c:
msecs_to_jiffies(fan_watchdog_maxinterval * 1000));
drivers/power/supply/qcom_pmi8998_charger.c:
msecs_to_jiffies(1000));
drivers/rtc/rtc-isl1208.c:      unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
drivers/scsi/cxlflash/main.c:   ulong timeout =
msecs_to_jiffies(cmd->rcb.timeout * 2 * 1000);
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:         end_time = jiffies +
msecs_to_jiffies(1000);
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c: end_time = jiffies +
msecs_to_jiffies(1000);
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c:         end_time = jiffies +
msecs_to_jiffies(1000);
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c: end_time = jiffies +
msecs_to_jiffies(1000);
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c: hisi_hba->timer.expires =
jiffies + msecs_to_jiffies(1000);
drivers/scsi/lpfc/lpfc.h:#define QUEUE_RAMP_DOWN_INTERVAL
(msecs_to_jiffies(1000 * 1))
drivers/scsi/lpfc/lpfc_bsg.c:           msecs_to_jiffies(1000 *
drivers/scsi/lpfc/lpfc_bsg.c:           msecs_to_jiffies(1000 *
drivers/scsi/lpfc/lpfc_els.c:                                     msecs_to_jiffies(1000 * tmo));
drivers/scsi/lpfc/lpfc_els.c:                             jiffies + msecs_to_jiffies(1000 * tmo));
drivers/scsi/lpfc/lpfc_els.c:                             jiffies + msecs_to_jiffies(1000 *
timeout));
drivers/scsi/lpfc/lpfc_els.c:                   jiffies + msecs_to_jiffies(1000 *
phba->fc_ratov));
drivers/scsi/lpfc/lpfc_els.c:   mod_timer(&ndlp->nlp_delayfunc, jiffies +
msecs_to_jiffies(1000));
drivers/scsi/lpfc/lpfc_hbadisc.c:       mod_timer(&vport->fc_disctmo, jiffies
+ msecs_to_jiffies(1000 * tmo));
drivers/scsi/lpfc/lpfc_init.c:            jiffies + msecs_to_jiffies(1000 *
timeout));
drivers/scsi/lpfc/lpfc_init.c:            jiffies + msecs_to_jiffies(1000 *
phba->eratt_poll_interval));
drivers/scsi/lpfc/lpfc_init.c:                            jiffies + msecs_to_jiffies(1000));
drivers/scsi/lpfc/lpfc_nportdisc.c:     mod_timer(&ndlp->nlp_delayfunc,
jiffies + msecs_to_jiffies(1000));
drivers/scsi/lpfc/lpfc_nportdisc.c:                               jiffies + msecs_to_jiffies(1000));
drivers/scsi/lpfc/lpfc_nportdisc.c:                       jiffies + msecs_to_jiffies(1000));
drivers/scsi/lpfc/lpfc_scsi.c:
msecs_to_jiffies(2*vport->cfg_devloss_tmo*1000));
drivers/scsi/lpfc/lpfc_scsi.c:  later = msecs_to_jiffies(2 *
vport->cfg_devloss_tmo * 1000) + jiffies;
drivers/scsi/lpfc/lpfc_scsi.c:  later = msecs_to_jiffies(2 *
vport->cfg_devloss_tmo * 1000) + jiffies;
drivers/scsi/lpfc/lpfc_sli.c:   next_time = jiffies +
msecs_to_jiffies(1000 * (phba->fc_ratov + 1));
drivers/scsi/lpfc/lpfc_sli.c:                           msecs_to_jiffies(1000 * (phba->fc_ratov
+ 1));
drivers/scsi/lpfc/lpfc_sli.c:                             msecs_to_jiffies(1000 *
(phba->fc_ratov << 1)));
drivers/scsi/lpfc/lpfc_sli.c:                     msecs_to_jiffies(1000 *
phba->eratt_poll_interval));
drivers/scsi/lpfc/lpfc_sli.c:             jiffies + msecs_to_jiffies(1000 *
(phba->fc_ratov * 2)));
drivers/scsi/lpfc/lpfc_sli.c:             jiffies + msecs_to_jiffies(1000 *
phba->eratt_poll_interval));
drivers/scsi/lpfc/lpfc_sli.c:             msecs_to_jiffies(1000 *
lpfc_mbox_tmo_val(phba, mboxq))));
drivers/scsi/lpfc/lpfc_sli.c:           timeout_req = msecs_to_jiffies(timeout *
1000);
drivers/scsi/lpfc/lpfc_sli.c:                                       msecs_to_jiffies(timeout * 1000));
drivers/scsi/lpfc/lpfc_vport.c: wait_time_max =
msecs_to_jiffies(((phba->fc_ratov * 3) + 3) * 1000);
drivers/scsi/mpt3sas/mpt3sas_base.c:        msecs_to_jiffies(10000));
drivers/scsi/mpt3sas/mpt3sas_base.c:        msecs_to_jiffies(10000));
drivers/soc/apple/rtkit.c:                                                    msecs_to_jiffies(1000));
drivers/soc/qcom/rpmh.c:#define RPMH_TIMEOUT_MS                 msecs_to_jiffies(10000)
drivers/spi/atmel-quadspi.c:                                     msecs_to_jiffies(1000)))
drivers/spi/spi-at91-usart.c:#define US_DMA_TIMEOUT
(msecs_to_jiffies(1000))
drivers/spi/spi-fsl-qspi.c:     if (!wait_for_completion_timeout(&q->c,
msecs_to_jiffies(1000)))
drivers/spi/spi-img-spfi.c:             msecs_to_jiffies(xfer->len * 8 * 1000 /
xfer->speed_hz + 100);
drivers/spi/spi-microchip-core-qspi.c:  if
(!wait_for_completion_timeout(&qspi->data_completion,
msecs_to_jiffies(1000)))
drivers/spi/spi-nxp-fspi.c:     if (!wait_for_completion_timeout(&f->c,
msecs_to_jiffies(1000)))
drivers/spi/spi-omap2-mcspi.c:  timeout = jiffies + msecs_to_jiffies(1000);
drivers/spi/spi-sunplus-sp7021.c:       unsigned long timeout =
msecs_to_jiffies(1000);
drivers/spi/spi-tegra114.c:#define SPI_DMA_TIMEOUT
(msecs_to_jiffies(1000))
drivers/spi/spi-tegra20-sflash.c:#define SPI_DMA_TIMEOUT
(msecs_to_jiffies(1000))
drivers/spi/spi-tegra20-slink.c:#define SLINK_DMA_TIMEOUT
(msecs_to_jiffies(1000))
drivers/spi/spi-tegra210-quad.c:#define QSPI_DMA_TIMEOUT
(msecs_to_jiffies(1000))
drivers/spi/spi-xlp.c:                                          msecs_to_jiffies(1000));
drivers/spi/spi-zynq-qspi.c:                                                           msecs_to_jiffies(1000)))
drivers/spi/spi-zynq-qspi.c:                                                           msecs_to_jiffies(1000)))
drivers/spi/spi-zynq-qspi.c:                                                           msecs_to_jiffies(1000)))
drivers/spi/spi-zynq-qspi.c:                                                           msecs_to_jiffies(1000)))
drivers/spi/spi-zynqmp-gqspi.c: timeout = jiffies + msecs_to_jiffies(1000);
drivers/staging/greybus/fw-download.c:#define NEXT_REQ_TIMEOUT_J
msecs_to_jiffies(1000)
drivers/staging/media/ipu3/ipu3.c:          imgu_css_queue_empty(&imgu->css),
msecs_to_jiffies(1000)))
drivers/staging/media/omap4iss/iss.c:                           msecs_to_jiffies(1000))) {
drivers/tty/serial/xilinx_uartps.c:     timeout = jiffies +
msecs_to_jiffies(1000);
drivers/tty/serial/xilinx_uartps.c:     timeout = jiffies +
msecs_to_jiffies(1000);
drivers/usb/atm/speedtch.c:     mod_timer(&instance->status_check_timer,
jiffies + msecs_to_jiffies(1000));
drivers/usb/atm/ueagle-atm.c:   ret = uea_wait(sc, 0, msecs_to_jiffies(1000));
drivers/usb/atm/ueagle-atm.c:                   uea_wait(sc, 0, msecs_to_jiffies(1000));
drivers/usb/gadget/function/f_uvc.c:                            uvc->func_connected == false,
msecs_to_jiffies(1000));
drivers/usb/gadget/udc/at91_udc.c:#define VBUS_POLL_TIMEOUT
msecs_to_jiffies(1000)
drivers/usb/musb/musb_core.c:                                 msecs_to_jiffies(1000));
drivers/usb/musb/ux500.c:       unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
drivers/usb/storage/realtek_cr.c:       chip->timer_expires = jiffies +
msecs_to_jiffies(1000*ss_delay);
drivers/usb/typec/tipd/core.c:  timeout = jiffies + msecs_to_jiffies(1000);
drivers/usb/typec/ucsi/ucsi_ccg.c:      unsigned long target = jiffies +
msecs_to_jiffies(1000);
drivers/video/fbdev/omap2/omapfb/dss/dsi.c:                             msecs_to_jiffies(1000))
== 0) {
drivers/w1/masters/ds2490.c:    const unsigned long jtime =
msecs_to_jiffies(1000*8/75);
fs/btrfs/disk-io.c:             delay = msecs_to_jiffies(fs_info->commit_interval *
1000);
fs/btrfs/disk-io.c:                     delay -= msecs_to_jiffies((delta - 1) * 1000);
fs/btrfs/disk-io.c:                                 msecs_to_jiffies(fs_info->commit_interval *
1000));
fs/ocfs2/cluster/heartbeat.c:                           msecs_to_jiffies(1000));
fs/ocfs2/dlm/dlmmaster.c:                  msecs_to_jiffies(1000));
fs/ocfs2/dlm/dlmrecovery.c:                                                        msecs_to_jiffies(1000));
fs/ocfs2/dlm/dlmrecovery.c:                                      msecs_to_jiffies(1000));
fs/pstore/zone.c:               schedule_delayed_work(&psz_cleaner,
msecs_to_jiffies(1000));
fs/xfs/xfs_icache.c:                               msecs_to_jiffies(xfs_blockgc_secs * 1000));
include/drm/gpu_scheduler.h:#define MAX_WAIT_SCHED_ENTITY_Q_EMPTY
msecs_to_jiffies(1000)
include/linux/ceph/libceph.h:#define CEPH_MOUNT_TIMEOUT_DEFAULT
msecs_to_jiffies(60 * 1000)
include/linux/ceph/libceph.h:#define CEPH_OSD_KEEPALIVE_DEFAULT
msecs_to_jiffies(5 * 1000)
include/linux/ceph/libceph.h:#define CEPH_OSD_IDLE_TTL_DEFAULT
msecs_to_jiffies(60 * 1000)
include/linux/ceph/libceph.h:#define CEPH_MONC_HUNT_INTERVAL
msecs_to_jiffies(3 * 1000)
include/linux/ceph/libceph.h:#define CEPH_MONC_PING_INTERVAL
msecs_to_jiffies(10 * 1000)
include/linux/ceph/libceph.h:#define CEPH_MONC_PING_TIMEOUT
msecs_to_jiffies(30 * 1000)
include/net/bluetooth/coredump.h:#define DEVCOREDUMP_TIMEOUT
msecs_to_jiffies(10000) /* 10 sec */
include/net/bluetooth/hci.h:#define HCI_INIT_TIMEOUT
msecs_to_jiffies(10000) /* 10 seconds */
include/net/bluetooth/l2cap.h:#define L2CAP_WAIT_ACK_TIMEOUT
msecs_to_jiffies(10000)
kernel/kcsan/kcsan_test.c:      end_time += msecs_to_jiffies(1000); /* This
test requires a bit more time. */
kernel/power/energy_model.c:                                          msecs_to_jiffies(1000));
net/batman-adv/distributed-arp-table.c:                    msecs_to_jiffies(10000));
net/bluetooth/hci_sync.c:                                  msecs_to_jiffies(timeout * 1000));
net/bluetooth/mgmt.c:           int to = msecs_to_jiffies(hdev->discov_timeout *
1000);
net/bluetooth/mgmt.c:                   int to = msecs_to_jiffies(hdev->discov_timeout *
1000);
net/bridge/br_private.h:#define BR_MULTICAST_QUERY_INTVL_MIN
msecs_to_jiffies(1000)
net/ceph/ceph_common.c:             msecs_to_jiffies(result.uint_32 * 1000);
net/ceph/ceph_common.c:         opt->osd_idle_ttl =
msecs_to_jiffies(result.uint_32 * 1000);
net/ceph/ceph_common.c:         opt->mount_timeout =
msecs_to_jiffies(result.uint_32 * 1000);
net/ceph/ceph_common.c:             msecs_to_jiffies(result.uint_32 * 1000);
net/core/page_pool.c:#define DEFER_TIME (msecs_to_jiffies(1000))
net/ipv4/ipconfig.c:                       msecs_to_jiffies(carrier_timeout * 1000))) {
net/mac802154/scan.c:                              msecs_to_jiffies(1000));
net/mac802154/scan.c:                              msecs_to_jiffies(1000));
net/netfilter/xt_IDLETIMER.c:             msecs_to_jiffies(info->timeout * 1000)
+ jiffies);
net/netfilter/xt_IDLETIMER.c:                           msecs_to_jiffies(info->timeout * 1000)
+ jiffies);
net/netfilter/xt_IDLETIMER.c:             msecs_to_jiffies(info->timeout * 1000)
+ jiffies);
net/netfilter/xt_IDLETIMER.c:                           msecs_to_jiffies(info->timeout * 1000)
+ jiffies);
net/netfilter/xt_IDLETIMER.c:                     msecs_to_jiffies(info->timeout * 1000)
+ jiffies);
net/netfilter/xt_IDLETIMER.c:                                   msecs_to_jiffies(info->timeout * 1000)
+ jiffies);
net/nfc/nci/spi.c:                                              msecs_to_jiffies(1000)) == 0) {
net/tipc/crypto.c:#define TIPC_TX_LASTING_TIME  msecs_to_jiffies(10000)
/* 10s */
net/tipc/discover.c:#define TIPC_DISC_FAST      msecs_to_jiffies(1000)
net/tipc/discover.c:            tn->addr_trial_end = jiffies + msecs_to_jiffies(1000);
net/tipc/discover.c:            tn->addr_trial_end = jiffies + msecs_to_jiffies(1000);
samples/connector/cn_test.c:    mod_timer(&cn_test_timer, jiffies +
msecs_to_jiffies(1000));
samples/connector/cn_test.c:    mod_timer(&cn_test_timer, jiffies +
msecs_to_jiffies(1000));
scripts/coccinelle/misc/secs_to_jiffies.cocci:/// -
msecs_to_jiffies(value*1000)
scripts/coccinelle/misc/secs_to_jiffies.cocci:- msecs_to_jiffies(C * 1000)
sound/hda/hdac_controller.c:    timeout = jiffies + msecs_to_jiffies(1000);
sound/isa/wss/wss_lib.c:        unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
sound/pci/ac97/ac97_codec.c:                                  msecs_to_jiffies(power_save * 1000));
sound/pci/hda/hda_intel.c:                                                    msecs_to_jiffies(1000));
sound/pci/hda/patch_ca0132.c:   unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
sound/pci/hda/patch_ca0132.c:   unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
sound/pci/hda/patch_ca0132.c:   unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
sound/pci/hda/patch_ca0132.c:   unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
sound/pci/hda/patch_ca0132.c:           unsigned long timeout = jiffies +
msecs_to_jiffies(1000);
sound/pci/lola/lola.c:  timeout = jiffies + msecs_to_jiffies(1000);
sound/soc/codecs/cs42l43-jack.c:                           msecs_to_jiffies(1000));
sound/soc/codecs/cs43130.c:                                       msecs_to_jiffies(1000));
sound/soc/codecs/rt5677.c:                                      msecs_to_jiffies(1000));
sound/soc/codecs/wm8971.c:                              &wm8971->charge_work, msecs_to_jiffies(1000));
sound/soc/codecs/wm8994.c:                                         msecs_to_jiffies(1000));
sound/usb/endpoint.c:   unsigned long end_time = jiffies +
msecs_to_jiffies(1000);
sound/usb/mixer_scarlett2.c:                                     msecs_to_jiffies(1000))) {



>
> The entire conversion is made with Coccinelle in the script added in
> patch 2. Some changes suggested by Coccinelle have been deferred to
> later parts that will address other possible variant patterns.
>
> CC: Anna-Maria Behnsen <anna-maria@linutronix.de>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
>
> [1] https://lore.kernel.org/all/20241030-open-coded-timeouts-v3-0-9ba123facf88@linux.microsoft.com/
> [2] https://lore.kernel.org/all/8734kngfni.fsf@somnus/
>
> ---
> Changes in v2:
> - EDITME: describe what is new in this series revision.
> - EDITME: use bulletpoints and terse descriptions.
> - Link to v1: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v1-0-19aadc34941b@linux.microsoft.com
>
> ---
> Easwar Hariharan (21):
>        netfilter: conntrack: Cleanup timeout definitions
>        coccinelle: misc: Add secs_to_jiffies script
>        arm: pxa: Convert timeouts to use secs_to_jiffies()
>        s390: kernel: Convert timeouts to use secs_to_jiffies()
>        powerpc/papr_scm: Convert timeouts to secs_to_jiffies()
>        mm: kmemleak: Convert timeouts to secs_to_jiffies()
>        accel/habanalabs: Convert timeouts to secs_to_jiffies()
>        drm/xe: Convert timeout to secs_to_jiffies()
>        drm/etnaviv: Convert timeouts to secs_to_jiffies()
>        scsi: lpfc: Convert timeouts to secs_to_jiffies()
>        scsi: arcmsr: Convert timeouts to secs_to_jiffies()
>        scsi: pm8001: Convert timeouts to secs_to_jiffies()
>        xen/blkback: Convert timeouts to secs_to_jiffies()
>        gve: Convert timeouts to secs_to_jiffies()
>        wifi: ath11k: Convert timeouts to secs_to_jiffies()
>        Bluetooth: MGMT: Convert timeouts to secs_to_jiffies()
>        staging: vc04_services: Convert timeouts to secs_to_jiffies()
>        ceph: Convert timeouts to secs_to_jiffies()
>        livepatch: Convert timeouts to secs_to_jiffies()
>        ALSA: line6: Convert timeouts to secs_to_jiffies()
>        nfp: Convert timeouts to secs_to_jiffies()
>
>   arch/arm/mach-pxa/sharpsl_pm.c                      |  6 +++---
>   arch/powerpc/platforms/pseries/papr_scm.c           |  2 +-
>   arch/s390/kernel/lgr.c                              |  3 ++-
>   arch/s390/kernel/time.c                             |  4 ++--
>   arch/s390/kernel/topology.c                         |  2 +-
>   drivers/accel/habanalabs/common/device.c            |  2 +-
>   drivers/accel/habanalabs/common/habanalabs_drv.c    |  3 +--
>   drivers/block/xen-blkback/blkback.c                 |  2 +-
>   drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c            |  2 +-
>   drivers/gpu/drm/xe/xe_device.c                      |  2 +-
>   drivers/net/ethernet/google/gve/gve_tx_dqo.c        |  6 ++----
>   drivers/net/ethernet/netronome/nfp/nfp_net_common.c |  2 +-
>   drivers/net/wireless/ath/ath11k/debugfs.c           |  2 +-
>   drivers/scsi/arcmsr/arcmsr_hba.c                    |  2 +-
>   drivers/scsi/lpfc/lpfc_init.c                       | 18 +++++++++---------
>   drivers/scsi/lpfc/lpfc_nportdisc.c                  |  8 ++++----
>   drivers/scsi/lpfc/lpfc_nvme.c                       |  2 +-
>   drivers/scsi/lpfc/lpfc_sli.c                        |  4 ++--
>   drivers/scsi/lpfc/lpfc_vmid.c                       |  2 +-
>   drivers/scsi/pm8001/pm8001_init.c                   |  2 +-
>   .../vc04_services/bcm2835-audio/bcm2835-vchiq.c     |  2 +-
>   fs/ceph/quota.c                                     |  2 +-
>   mm/kmemleak.c                                       |  4 ++--
>   net/bluetooth/mgmt.c                                |  2 +-
>   net/netfilter/nf_conntrack_proto_sctp.c             | 21 ++++++++-------------
>   samples/livepatch/livepatch-callbacks-busymod.c     |  2 +-
>   samples/livepatch/livepatch-shadow-fix1.c           |  2 +-
>   samples/livepatch/livepatch-shadow-mod.c            | 10 +++++-----
>   scripts/coccinelle/misc/secs_to_jiffies.cocci       | 21 +++++++++++++++++++++
>   sound/usb/line6/toneport.c                          |  2 +-
>   30 files changed, 79 insertions(+), 65 deletions(-)
> ---
> base-commit: 2d5404caa8c7bb5c4e0435f94b28834ae5456623
> change-id: 20241112-converge-secs-to-jiffies-d99d1016bd11
>
> Best regards,
> --
> Easwar Hariharan <eahariha@linux.microsoft.com>
>
Christophe Leroy Nov. 16, 2024, 10:26 a.m. UTC | #14
Le 15/11/2024 à 22:26, Easwar Hariharan a écrit :
> [Vous ne recevez pas souvent de courriers de eahariha@linux.microsoft.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> Changes made with the following Coccinelle rules:
> 
> @@ constant C; @@
> 
> - msecs_to_jiffies(C * 1000)
> + secs_to_jiffies(C)
> 
> @@ constant C; @@
> 
> - msecs_to_jiffies(C * MSEC_PER_SEC)
> + secs_to_jiffies(C)
> 
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> ---
>   arch/arm/mach-pxa/sharpsl_pm.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
> index 72fa2e3fd35318e5a63c121ed7990a56a56b134c..bbbd06bc79bbb94fb258562e5a382acaf3c277b3 100644
> --- a/arch/arm/mach-pxa/sharpsl_pm.c
> +++ b/arch/arm/mach-pxa/sharpsl_pm.c
> @@ -31,9 +31,9 @@
>   /*
>    * Constants
>    */
> -#define SHARPSL_CHARGE_ON_TIME_INTERVAL        (msecs_to_jiffies(1*60*1000))  /* 1 min */
> -#define SHARPSL_CHARGE_FINISH_TIME             (msecs_to_jiffies(10*60*1000)) /* 10 min */
> -#define SHARPSL_BATCHK_TIME                    (msecs_to_jiffies(15*1000))    /* 15 sec */
> +#define SHARPSL_CHARGE_ON_TIME_INTERVAL        (secs_to_jiffies(60))  /* 1 min */
> +#define SHARPSL_CHARGE_FINISH_TIME             (secs_to_jiffies(10*60)) /* 10 min */
> +#define SHARPSL_BATCHK_TIME                    (secs_to_jiffies(15))    /* 15 sec */

This comment is completely useless now.

The other ones are probably also kind of useless, everybody knows 1 min 
= 60 sec. See https://docs.kernel.org/process/coding-style.html#commenting



>   #define SHARPSL_BATCHK_TIME_SUSPEND            (60*10)                        /* 10 min */
> 
>   #define SHARPSL_WAIT_CO_TIME                   15  /* 15 sec */
> 
> --
> 2.34.1
>
Dan Carpenter Nov. 16, 2024, 10:40 a.m. UTC | #15
On Sat, Nov 16, 2024 at 11:06:55AM +0100, Christophe Leroy wrote:
> > diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c
> > index 9e297f88adc5d97d4dc7b267b0bfebd58e5cf193..9e8086ec66e0f0e555ac27933854c06cfcf91a04 100644
> > --- a/arch/powerpc/platforms/pseries/papr_scm.c
> > +++ b/arch/powerpc/platforms/pseries/papr_scm.c
> > @@ -543,7 +543,7 @@ static int drc_pmem_query_health(struct papr_scm_priv *p)
> > 
> >          /* Jiffies offset for which the health data is assumed to be same */
> >          cache_timeout = p->lasthealth_jiffies +
> > -               msecs_to_jiffies(MIN_HEALTH_QUERY_INTERVAL * 1000);
> > +               secs_to_jiffies(MIN_HEALTH_QUERY_INTERVAL);
> 
> Wouldn't it now fit on a single line ?
> 

Some maintainers still prefer to put a line break at 80 characters.  It's kind
of a nightmare for an automated script like this to figure out everyone's
preferences.  In this particular file, there are some lines which go over 80
characters so sure.  Earlier in the patchset one of these introduced a line
break that wasn't there before so I think maybe Coccinelle is applying the 80
character line break rule?

There are sometimes where the 80 character rule really hurts readability, but
here it doesn't make any difference.

regards,
dan carpenter