ASoC: codecs: rt5677: Use secs_to_jiffies() instead of msecs_to_jiffies()
authorThorsten Blum <thorsten.blum@linux.dev>
Sat, 5 Apr 2025 12:58:08 +0000 (14:58 +0200)
committerMark Brown <broonie@kernel.org>
Sun, 6 Apr 2025 22:25:18 +0000 (23:25 +0100)
Use secs_to_jiffies() instead of msecs_to_jiffies() and avoid scaling
'delay' to milliseconds.

Since 'delay' isn't a compile-time constant, secs_to_jiffies() expands
to much simpler code compared to msecs_to_jiffies(), reducing the size
of 'snd-soc-rt5677-spi.ko' by 472 bytes.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250405125808.302259-1-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5677-spi.c

index abe0a5a95770043c460ce1a45f0d9a16df8f31d3..885edcf0a3a508ed929234f50b982fe89d6fb6ce 100644 (file)
@@ -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);
 }