Re: [PATCH 04/16] ALSA: ac97: convert timeouts to secs_to_jiffies()

Takashi Iwai
2025-01-29T09:47:02Z

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
>