Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ASoC: codecs: rt5677: Use secs_to_jiffies() instead of msecs_to_jiffies()
@ 2025-04-05 12:58 Thorsten Blum
  2025-04-07 23:35 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-04-05 12:58 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.

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>
---
 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] 2+ messages in thread

* Re: [PATCH] ASoC: codecs: rt5677: Use secs_to_jiffies() instead of msecs_to_jiffies()
  2025-04-05 12:58 [PATCH] ASoC: codecs: rt5677: Use secs_to_jiffies() instead of msecs_to_jiffies() Thorsten Blum
@ 2025-04-07 23:35 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-04-07 23:35 UTC (permalink / raw)
  To: Oder Chiou, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Thorsten Blum
  Cc: linux-sound, linux-kernel

On Sat, 05 Apr 2025 14:58:08 +0200, Thorsten Blum wrote:
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: codecs: rt5677: Use secs_to_jiffies() instead of msecs_to_jiffies()
      commit: 7afa96026f0a1d81b7e9cc8f1811cae4b80d4d94

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-07 23:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-05 12:58 [PATCH] ASoC: codecs: rt5677: Use secs_to_jiffies() instead of msecs_to_jiffies() Thorsten Blum
2025-04-07 23:35 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox