diff options
author | Shang XiaoJing <shangxiaojing@huawei.com> | 2022-09-27 22:09:47 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-10-17 12:48:22 +0100 |
commit | 4aa2b05a24a83cc618fab4c4d343f2179962e5ed (patch) | |
tree | 7098c773bcdc5d381ed45c3fcc6da5682341c1a9 /sound/soc/sh | |
parent | c54402609820427ff6f725f9182216e7cfe7cfa7 (diff) |
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 e4d8aef21403 ("ALSA: usb: Use
DIV_ROUND_UP() instead of open-coding it").
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Link: https://lore.kernel.org/r/20220927140948.17696-4-shangxiaojing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r-- | sound/soc/sh/rcar/core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 7e380d71b0f8..4e21ebce03c6 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -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; } |