Unverified Commit 4aa2b05a authored by Shang XiaoJing's avatar Shang XiaoJing Committed by Mark Brown
Browse files

ASoC: rsnd: Use DIV_ROUND_UP() instead of open-coding it



Use DIV_ROUND_UP() instead of open-coding it, which intents and makes it
more clear what is going on for the casual reviewer.

The Coccinelle references Commit e4d8aef2 ("ALSA: usb: Use
DIV_ROUND_UP() instead of open-coding it").

Signed-off-by: default avatarShang XiaoJing <shangxiaojing@huawei.com>
Link: https://lore.kernel.org/r/20220927140948.17696-4-shangxiaojing@huawei.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c5440260
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1581,9 +1581,9 @@ static int rsnd_hw_params(struct snd_soc_component *component,
				hw_params->cmask |= SNDRV_PCM_HW_PARAM_RATE;
			} else if (params_rate(hw_params) * k_up < io->converted_rate) {
				hw_param_interval(hw_params, SNDRV_PCM_HW_PARAM_RATE)->min =
					(io->converted_rate + k_up - 1) / k_up;
					DIV_ROUND_UP(io->converted_rate, k_up);
				hw_param_interval(hw_params, SNDRV_PCM_HW_PARAM_RATE)->max =
					(io->converted_rate + k_up - 1) / k_up;
					DIV_ROUND_UP(io->converted_rate, k_up);
				hw_params->cmask |= SNDRV_PCM_HW_PARAM_RATE;
			}