[PATCH 5.10 254/523] ALSA: pcm: Rewrite recalculate_boundary() to avoid costly loop