[PATCH 5.15 333/644] ALSA: pcm: Rewrite recalculate_boundary() to avoid costly loop