Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: cs35l36: 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>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220927140948.17696-2-shangxiaojing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Shang XiaoJing and committed by
Mark Brown
ff091dd2 2a9ad0cc

+2 -2
+2 -2
sound/soc/codecs/cs35l36.c
··· 918 918 fs1 = CS35L36_FS1_DEFAULT_VAL; 919 919 fs2 = CS35L36_FS2_DEFAULT_VAL; 920 920 } else { 921 - fs1 = 3 * ((CS35L36_FS_NOM_6MHZ * 4 + freq - 1) / freq) + 4; 922 - fs2 = 5 * ((CS35L36_FS_NOM_6MHZ * 4 + freq - 1) / freq) + 4; 921 + fs1 = 3 * DIV_ROUND_UP(CS35L36_FS_NOM_6MHZ * 4, freq) + 4; 922 + fs2 = 5 * DIV_ROUND_UP(CS35L36_FS_NOM_6MHZ * 4, freq) + 4; 923 923 } 924 924 925 925 regmap_write(cs35l36->regmap, CS35L36_TESTKEY_CTRL,