* [PATCH v2] ASoC: codecs: rt5677: Use secs_to_jiffies() instead of msecs_to_jiffies()
@ 2025-04-06 21:55 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2025-04-06 21:55 UTC (permalink / raw)
To: Oder Chiou, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai
Cc: Thorsten Blum, linux-sound, linux-kernel
Use secs_to_jiffies() instead of msecs_to_jiffies() and avoid scaling
'delay' to milliseconds. secs_to_jiffies() expands to simpler code and
reduces the size of 'snd-soc-rt5677-spi.ko'.
No functional changes intended.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
Changes in v2:
- Remove the number of bytes saved from the patch description as this
differs significantly by architecture, kernel config, etc.
- Link to v1: https://lore.kernel.org/lkml/20250405125808.302259-1-thorsten.blum@linux.dev/
---
sound/soc/codecs/rt5677-spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/rt5677-spi.c b/sound/soc/codecs/rt5677-spi.c
index abe0a5a95770..885edcf0a3a5 100644
--- a/sound/soc/codecs/rt5677-spi.c
+++ b/sound/soc/codecs/rt5677-spi.c
@@ -365,8 +365,8 @@ static void rt5677_spi_copy_work(struct work_struct *work)
new_bytes -= copy_bytes;
}
- delay = bytes_to_frames(runtime, period_bytes) / (runtime->rate / 1000);
- schedule_delayed_work(&rt5677_dsp->copy_work, msecs_to_jiffies(delay));
+ delay = bytes_to_frames(runtime, period_bytes) / runtime->rate;
+ schedule_delayed_work(&rt5677_dsp->copy_work, secs_to_jiffies(delay));
done:
mutex_unlock(&rt5677_dsp->dma_lock);
}
--
2.49.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-06 21:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-06 21:55 [PATCH v2] ASoC: codecs: rt5677: Use secs_to_jiffies() instead of msecs_to_jiffies() Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox