From: Shang XiaoJing Date: Tue, 27 Sep 2022 14:11:10 +0000 (+0800) Subject: ALSA: sb: Use DIV_ROUND_UP() instead of open-coding it X-Git-Tag: v6.1-rc1~158^2~1^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eefe77fdc0de86480f5dbb6bc721396d82d095d3;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://lore.kernel.org/r/20220927141110.18033-1-shangxiaojing@huawei.com Signed-off-by: Takashi Iwai --- diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c index f8d90a1e989b0..c8afc4347c54d 100644 --- a/sound/isa/sb/emu8000_pcm.c +++ b/sound/isa/sb/emu8000_pcm.c @@ -236,7 +236,7 @@ static int emu8k_pcm_open(struct snd_pcm_substream *subs) /* use timer to update periods.. (specified in msec) */ snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME, - (1000000 + HZ - 1) / HZ, UINT_MAX); + DIV_ROUND_UP(1000000, HZ), UINT_MAX); return 0; }