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

ALSA: sb: 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/20220927141110.18033-1-shangxiaojing@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Shang XiaoJing and committed by
Takashi Iwai
eefe77fd d1c44201

+1 -1
+1 -1
sound/isa/sb/emu8000_pcm.c
··· 236 236 237 237 /* use timer to update periods.. (specified in msec) */ 238 238 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME, 239 - (1000000 + HZ - 1) / HZ, UINT_MAX); 239 + DIV_ROUND_UP(1000000, HZ), UINT_MAX); 240 240 241 241 return 0; 242 242 }