Skip to contentSkip to conversation

ALSA: sb: Use DIV_ROUND_UP() instead of open-coding it

PATCH Applied Shang XiaoJing 2 participants 2 messages Sep 29, 2022 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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").

---
 sound/isa/sb/emu8000_pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/isa/sb/emu8000_pcm.c +1 -1
index f8d90a1e989b..c8afc4347c54 100644
@@ -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;
 }
Signature · 1 line
2.17.1
Applied
#1 lore raw
Quoted 8 lines · Shang XiaoJing

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").

Thanks, applied.

Takashi