Skip to contentSkip to conversation

ASoC: codecs: rt5677: Use secs_to_jiffies() instead of msecs_to_jiffies()

PATCH New Thorsten Blum 1 participant 1 message Apr 6, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ASoC: codecs: rt5677: Use secs_to_jiffies() instead of msecs_to_jiffies()

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.

---
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/[email protected]/

---
 sound/soc/codecs/rt5677-spi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/rt5677-spi.c +2 -2
index abe0a5a95770..885edcf0a3a5 100644
@@ -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);
 }
Signature · 1 line
2.49.0