Skip to content

Commit

Permalink
ALSA: vx: Use roundup() instead of open-coding it
Browse files Browse the repository at this point in the history
Use roundup() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-((((x) + (y) - 1) / (y)) * y)
+roundup(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
larsclausen authored and tiwai committed Dec 25, 2020
1 parent e4d8aef commit af102a8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sound/drivers/vx/vx_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,7 @@ static int vx_init_audio_io(struct vx_core *chip)
chip->ibl.size = 0;
vx_set_ibl(chip, &chip->ibl); /* query the info */
if (preferred > 0) {
chip->ibl.size = ((preferred + chip->ibl.granularity - 1) /
chip->ibl.granularity) * chip->ibl.granularity;
chip->ibl.size = roundup(preferred, chip->ibl.granularity);
if (chip->ibl.size > chip->ibl.max_size)
chip->ibl.size = chip->ibl.max_size;
} else
Expand Down

0 comments on commit af102a8

Please sign in to comment.